engine/generators/source/ShrineGenerator.cpp
// Shrines have a list of creatures, and a list of preset locations.  Each
// preset should have a creature.  Right now, for shrines, these preset
// locations are all the floor (dungeon) tiles, so go through the tiles
// in the map and add the appopriate ones.
Shrines have a list of creatures, and a list of preset locations.  Each
preset should have a creature.  Right now, for shrines, these preset
locations are all the floor (dungeon) tiles, so go through the tiles
in the map and add the appopriate ones.
Shrines have a list of creatures and a list of preset locations . Each preset should have a creature . Right now for shrines these preset locations are all the floor ( dungeon ) tiles so go through the tiles in the map and add the appopriate ones .
void ShrineGenerator::add_dungeon_tiles_to_preset_locations(MapPtr map)
{
  vector<Coordinate> preset_locs;
  if (map != nullptr)
  {
    TilesContainer tc = map->get_tiles();
    for (const auto& tile_pair : tc)
    {
      TilePtr tile = tile_pair.second;
      if (tile != nullptr && tile->get_tile_type() == TileType::TILE_TYPE_DUNGEON)
      {
        string key = tile_pair.first;
        Coordinate c = MapUtils::convert_map_key_to_coordinate(key);
        preset_locs.push_back(c);
      }
    }
    map->set_preset_locations(preset_locs);
  }
}
void ShrineGenerator :: add_dungeon_tiles_to_preset_locations ( MapPtr map ) { vector < Coordinate > preset_locs ; if ( map != nullptr ) { TilesContainer tc = map -> get_tiles ( ) ; for ( const auto & tile_pair : tc ) { TilePtr tile = tile_pair . second ; if ( tile != nullptr && tile -> get_tile_type ( ) == TileType :: TILE_TYPE_DUNGEON ) { string key = tile_pair . first ; Coordinate c = MapUtils :: convert_map_key_to_coordinate ( key ) ; preset_locs . push_back ( c ) ; } } map -> set_preset_locations ( preset_locs ) ; } }
Shrines have a list of creatures, and a list of preset locations.
Shrines have a list of creatures and a list of preset locations .