MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / getRoomTilesDefault

Method getRoomTilesDefault

source/rooms/RoomManager.cpp:152–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152bool RoomFactory::getRoomTilesDefault(std::vector<Tile*>& tiles, GameMap* gameMap, Player* player, ODPacket& packet) const
153{
154 uint32_t nbTiles;
155 OD_ASSERT_TRUE(packet >> nbTiles);
156
157 while(nbTiles > 0)
158 {
159 --nbTiles;
160 Tile* tile = gameMap->tileFromPacket(packet);
161 if(tile == nullptr)
162 {
163 OD_LOG_ERR("unexpected null tile");
164 return false;
165 }
166
167 if(!tile->isBuildableUpon(player->getSeat()))
168 {
169 OD_LOG_ERR("tile=" + Tile::displayAsString(tile) + ", seatId=" + Helper::toString(player->getSeat()->getId()));
170 continue;
171 }
172
173 tiles.push_back(tile);
174 }
175
176 return true;
177}
178
179bool RoomFactory::buildRoomDefault(GameMap* gameMap, Room* room, Seat* seat, const std::vector<Tile*>& tiles) const
180{

Callers

nothing calls this directly

Calls 5

tileFromPacketMethod · 0.80
isBuildableUponMethod · 0.80
toStringFunction · 0.50
getSeatMethod · 0.45
getIdMethod · 0.45

Tested by

no test coverage detected