protected Tile(Map home, Coords position, TileGenerator generator) : this(home, position) { this._myName = generator.name; //this._visibilityCoefficient = generator.visibilityCoefficient; this._myBitmap = generator.tileBitmap; }
// Fills a space with tiles of "tileType" private void FillRectangleWithTiles(Map homeMap, Coords topLeft, Coords bottomRight, TileGenerator tileType) { Coords difference = bottomRight - topLeft; if (!(difference.X > -1 && difference.Y > -1)) { return; } // There should be a more elegant way of dealing with the "Is it passable or impassable?" problem. if (tileType.passable) { for (int i = 0; i < difference.X + 1; ++i) { for (int j = 0; j < difference.Y + 1; ++j) { Coords currentCoords = new Coords(CoordsType.Tile, topLeft.X + i, topLeft.Y + j); homeMap.SetTile(currentCoords, new TilePassable(homeMap, currentCoords, tileType)); } } } else { for (int i = 0; i < difference.X + 1; ++i) { for (int j = 0; j < difference.Y + 1; ++j) { Coords currentCoords = new Coords(CoordsType.Tile, topLeft.X + i, topLeft.Y + j); homeMap.SetTile(currentCoords, new TileImpassable(homeMap, currentCoords, tileType)); } } } }
public TilePassable(Map home, Coords position, TileGenerator generator) : base(home, position, generator) { this._myInventory = new Inventory(this); }
public TileImpassable(Map home, Coords position, TileGenerator generator) : base(home, position, generator) { }