| 109 | } |
| 110 | |
| 111 | bool TrapFactory::getTrapTilesDefault(std::vector<Tile*>& tiles, GameMap* gameMap, Player* player, ODPacket& packet) const |
| 112 | { |
| 113 | uint32_t nbTiles; |
| 114 | OD_ASSERT_TRUE(packet >> nbTiles); |
| 115 | |
| 116 | while(nbTiles > 0) |
| 117 | { |
| 118 | --nbTiles; |
| 119 | Tile* tile = gameMap->tileFromPacket(packet); |
| 120 | if(tile == nullptr) |
| 121 | { |
| 122 | OD_LOG_ERR("unexpected null tile"); |
| 123 | return false; |
| 124 | } |
| 125 | |
| 126 | if(!tile->isBuildableUpon(player->getSeat())) |
| 127 | { |
| 128 | OD_LOG_ERR("tile=" + Tile::displayAsString(tile) + ", seatId=" + Helper::toString(player->getSeat()->getId())); |
| 129 | continue; |
| 130 | } |
| 131 | |
| 132 | tiles.push_back(tile); |
| 133 | } |
| 134 | |
| 135 | return true; |
| 136 | } |
| 137 | |
| 138 | bool TrapFactory::buildTrapDefault(GameMap* gameMap, Trap* trap, Seat* seat, const std::vector<Tile*>& tiles) const |
| 139 | { |
nothing calls this directly
no test coverage detected