Пример #1
0
 public static bool MoveTo(this Agent ag, Coordinates pos, float speed = 1f, bool usePathFinding = false, int maxDistance = 16)
 {
     if (usePathFinding)
     {
         if (ag.Owner.Level.GetPath(out var path, ag.Owner.GetTilePosition().AsNode(), pos.AsNode(), WalkablePredicat))
         {
             foreach (var n in path)
             {
                 ag.MoveTo(new Coordinates(n.X, n.Y), speed);
             }
         }
         else
         {
             return(false);
         }
     }