Exemple #1
0
    bool CanFinishPathInMoves(int moves, List <List <Tile> > paths)
    {
        int range = moves * getMove().GetMoveRange();

        foreach (List <Tile> path in paths)
        {
            if (TilePathFinder.GetPathLengthForUnit(m_unit, path) <= range)
            {
                return(true);
            }
        }
        return(false);
    }
Exemple #2
0
    public Tile GetFurthestMovibleTileOnPath(List <Tile> path)
    {
        float longest = 0;
        Tile  t       = null;

        for (int i = 0; i < path.Count; i++)
        {
            List <Tile> sub_path = path.GetRange(0, i + 1);

            float length = TilePathFinder.GetPathLengthForUnit(Owner, sub_path);
            if (PathWalkable(sub_path) && length > longest)
            {
                t       = path[i];
                longest = length;
            }
        }

        return(t);
    }
Exemple #3
0
    public bool PathWalkable(List <Tile> p)
    {
        float MoveRange = GetMoveRange();

        return(p != null && p.Count > 1 && TilePathFinder.GetPathLengthForUnit(Owner, p) <= MoveRange);
    }