Пример #1
0
    override protected void FinishSearch(IPath.Path foundPath, GameTile startPos, GameTile goalPos)
    {
        GameTile tile = goalPos;

        while (true)
        {
            if (tile == null || tile == startPos)
            {
                break;
            }

            foundPath.path.Push(tile);
            tile = blockStates.parentTile[(int)tile.num];
        }
    }
Пример #2
0
 abstract protected void FinishSearch(IPath.Path path, GameTile startPos, GameTile goalPos);
Пример #3
0
    public IPath.SearchResult GetPath(Enemy owner, GameTile startPos, GameTile goalPos, IPath.Path path)
    {
        IPath.SearchResult result = InitSeatch(owner, startPos, goalPos);
        if (result == IPath.SearchResult.Ok || result == IPath.SearchResult.GoalOutOfRange)
        {
            FinishSearch(path, startPos, goalPos);
        }

        return(result);
    }