Example #1
0
 public FindReachableNodes(GridBaseAbstract <Coords> grid, Coords start, int radius, GridAgentAbstract <Coords> avatar)
     : base(grid, start, radius)
 {
     mAgent                  = avatar;
     mOpenNodes              = new Dictionary <uint, int>();
     mResultNodes            = new Dictionary <uint, int>();
     mOpenNodes[start.index] = 0;
 }
Example #2
0
 public DepthSearch(GridBaseAbstract <Coords> grid, Coords start, int radius)
     : base(grid)
 {
     mStart    = start;
     mRadius   = radius;
     mOpenList = new Queue <uint>();
     mOpenList.Enqueue(start.index);
 }
Example #3
0
 public FindPath(GridBaseAbstract <Coords> grid, Coords start, Coords end, GridAgentAbstract <Coords> avatar)
     : base(grid, start, end)
 {
     mAgent = avatar;
     if (!IsNodeValidEndpoint(end))
     {
         Finished = true;
     }
 }
Example #4
0
 public GetLineTo(GridBaseAbstract <Coords> grid, Coords start, Coords end)
     : base(grid)
 {
     mStart      = start;
     mEnd        = end;
     mOpenList   = new LinkedList <openNode>();
     mClosedList = new Dictionary <uint, openNode>();
     Init();
 }
Example #5
0
 public bool Init(GridBaseAbstract <Coords> grid, Coords pos)
 {
     mGrid = grid;
     cell  = pos.index;
     if (Grid != null && cell != uint.MaxValue)
     {
         mId = Grid.NextAgentId;
         transform.SetParent(Grid.transform);
         transform.position = Grid.GetCellPos(pos);
         return(true);
     }
     return(false);
 }
Example #6
0
 public Search(GridBaseAbstract <Coords> grid)
 {
     mFinished = false;
     mGrid     = grid;
     mResults  = new List <uint>();
 }
Example #7
0
 public void Init(GridBaseAbstract <Coords> grid, GridAgentBrain brain, Coords pos)
 {
     Init(grid, pos);
     SetBrain(brain);
 }