Пример #1
0
 private static void FillTileset(Tileset[,] tilesets, int row, int column, TerrainCategoryMetadata terrainMetadata)
 {
     var isSpaceForLargeTileset =
         row < (tilesets.GetLength(0) - 1) &&
         column < (tilesets.GetLength(1) - 1) &&
         tilesets[row, column + 1] == null &&
         tilesets[row + 1, column] == null &&
         tilesets[row + 1, column + 1] == null;
     var terrainTilesets = isSpaceForLargeTileset ? terrainMetadata.AllTilesets : terrainMetadata.SmallTilesets;
     FillTileset(tilesets, row, column, terrainTilesets);
 }
Пример #2
0
 private static void FillTerrain(Tileset[,] tilesets, TerrainCategoryMetadata terrainMetadata)
 {
     foreach (var row in Enumerable.Range(0, tilesets.GetLength(0)))
         foreach (var column in Enumerable.Range(0, tilesets.GetLength(1)))
             if (tilesets[row, column] == null)
                 FillTileset(tilesets, row, column, terrainMetadata);
 }
Пример #3
0
 private static Map CreateUfoMap(Tileset craftTileset, Tileset ufoTileset, TerrainCategoryMetadata terrainMetadata)
 {
     var tilesets = CreateUfoMapTilesets(craftTileset, ufoTileset, terrainMetadata);
     var levels = CreateLevels(tilesets, 4);
     return new Map { Levels = levels };
 }
Пример #4
0
 private static Tileset[,] CreateUfoMapTilesets(Tileset craftTileset, Tileset ufoTileset, TerrainCategoryMetadata terrainMetadata)
 {
     var size = IsSmallUfoTileset(ufoTileset) ? 4 : 5;
     var tilesets = new Tileset[size, size];
     PlaceCraft(tilesets, ufoTileset, terrainMetadata.FlatTilesets);
     PlaceCraft(tilesets, craftTileset, terrainMetadata.FlatTilesets);
     FillTerrain(tilesets, terrainMetadata);
     return tilesets;
 }
Пример #5
0
 private static Map CreateAlienBaseMap(Tileset controlRoomTileset, TerrainCategoryMetadata baseMetadata)
 {
     var tilesets = new Tileset[6, 6];
     PlaceTileset(tilesets, controlRoomTileset);
     var entryTileset = Tileset.AlienBase4;
     PlaceTileset(tilesets, entryTileset);
     PlaceTileset(tilesets, entryTileset);
     FillTerrain(tilesets, baseMetadata);
     SetAlienBaseConnectors(tilesets);
     return new Map { Levels = CreateLevels(tilesets, 2) };
 }