Exemplo n.º 1
0
        public void Visualize(Pathfinder pathfinder)
        {
            if (cachedPathfinder != pathfinder || cachedContext == null)
            {
                cachedPathfinder = pathfinder;
                if (pathfinder.solver is AStar <Tile> astar)
                {
                    cachedContext = astar.context;
                }
                else if (pathfinder.solver is LPAStar <Tile> lpa)
                {
                    cachedContext = lpa.context;
                }
                else if (pathfinder.solver is DStarLite <Tile> dsl)
                {
                    cachedContext = dsl.context;
                }
                else if (pathfinder.solver is ThetaStar <Tile> theta)
                {
                    cachedContext = theta.context;
                }
            }

            dirty = true;
        }
Exemplo n.º 2
0
 public void Init(int x, int y, IPathfindingContext <Tile, INodeWrapper <Tile> > context)
 {
     this.x             = x;
     this.y             = y;
     this.cachedContext = context;
 }