Pathfinding.Path.DebugString C# (CSharp) Method

DebugString() public method

public DebugString ( PathLog logMode ) : string
logMode PathLog
return string
		public virtual string DebugString (PathLog logMode) {

			if (logMode == PathLog.None || (!error && logMode == PathLog.OnlyErrors)) {
				return "";
			}

			// Get a cached string builder for this thread
			System.Text.StringBuilder text = pathHandler.DebugStringBuilder;
			text.Length = 0;

			text.Append (error ? "Path Failed : " : "Path Completed : ");
			text.Append ("Computation Time ");

			text.Append ((duration).ToString (logMode == PathLog.Heavy ? "0.000 ms " : "0.00 ms "));
			text.Append ("Searched Nodes ");
			text.Append (searchedNodes);

			if (!error) {
				text.Append (" Path Length ");
				text.Append (path == null ? "Null" : path.Count.ToString ());

				if (logMode == PathLog.Heavy) {
					text.Append ("\nSearch Iterations "+searchIterations);
				}
			}

			if (error) {
				text.Append ("\nError: ");
				text.Append (errorLog);
			}

			if (logMode == PathLog.Heavy && !AstarPath.IsUsingMultithreading ) {
				text.Append ("\nCallback references ");
				if (callback != null) text.Append(callback.Target.GetType().FullName).AppendLine();
				else text.AppendLine ("NULL");
			}

			text.Append ("\nPath Number ");
			text.Append (pathID);

			return text.ToString ();
		}

Usage Example

 static int DebugString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         Pathfinding.Path obj  = (Pathfinding.Path)ToLua.CheckObject <Pathfinding.Path>(L, 1);
         PathLog          arg0 = (PathLog)ToLua.CheckObject(L, 2, typeof(PathLog));
         string           o    = obj.DebugString(arg0);
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
All Usage Examples Of Pathfinding.Path::DebugString