Beispiel #1
0
    public void FindWalkRange(int movement)
    {
        GraphSearch mSearch = new GraphSearch(mTileMap.MapInfo.mGraph);

        mSearch.RangeSearch(mPositionX, mPositionY, movement);
        mWalkRangeList = mSearch.GetCloseList();
        foreach (Node i in mWalkRangeList)
        {
            int index = i.mIndex;
            DTileMap.TileType temp = mTileMap.MapInfo.GetTileTypeIndex(index);
            if (temp == DTileMap.TileType.Floor)
            {
                mTileMap.MapInfo.SetTileTypeIndex(index, DTileMap.TileType.Walkable, true);
            }
            if (temp == DTileMap.TileType.Sewer)
            {
                mTileMap.MapInfo.SetTileTypeIndex(index, DTileMap.TileType.TrueSewer, true);
            }
        }
    }