public DoTile(DoTile copy) { this.X = copy.X; this.Y = copy.Y; this.Type = copy.Type; this.TopObject = copy.TopObject; }
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); } } }
public void SetTiles(DoTile[,] tiles) { Debug.Assert(tiles.GetLength(0) == WorldWidth && tiles.GetLength(1) == WorldHeight); worldTiles = tiles; }
public void SetTileAt(int x, int y, DoTile tile) { worldTiles[x, y] = tile; }
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; } }