Exemple #1
0
 public void addTile(Tile tile, Location location)
 {
     tile.location = location;
     if (_tiles.ContainsKey(location))
     {
         _tiles.Remove(location);
     }
     _tiles.Add(tile.location, tile);
 }
 private static void carveRoom(Level level, Rect rect, bool blocks, TileType tileType)
 {
     for (int x = rect.x1; x <= rect.x2; x++)
     {
         for (int y = rect.y1; y <= rect.y2; y++)
         {
             Tile tile = new Tile(blocks, tileType);
             level.addTile(tile, new Location(x, y));
         }
     }
 }