示例#1
0
 public DoTile(DoTile copy)
 {
     this.X = copy.X;
     this.Y = copy.Y;
     this.Type = copy.Type;
     this.TopObject = copy.TopObject;
 }
示例#2
0
    public DoWorld(int width, int height)
    {
        WorldWidth = width;
        WorldHeight = height;

        regions = new List<DoRegion>();
        worldTiles = new DoTile[WorldWidth, WorldHeight];

        for (int i = 0; i < WorldWidth; i++)
        {
            for (int j = 0; j < WorldHeight; j++)
            {
                worldTiles[i, j] = new DoTile(i, j);
            }
        }
    }
示例#3
0
 public void SetTiles(DoTile[,] tiles)
 {
     Debug.Assert(tiles.GetLength(0) == WorldWidth && tiles.GetLength(1) == WorldHeight);
     worldTiles = tiles;
 }
示例#4
0
 public void SetTileAt(int x, int y, DoTile tile)
 {
    worldTiles[x, y] = tile;
 }
示例#5
0
    public bool HasLowerNeighbour(int x, int y, DoTile.TileType type)
    {
        if (y - 1 < 0)
            return false;

        else
        {
            if (GetTileAt(x, y - 1).Type == type)
                return true;
            else
                return false;
        }
    }