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

Method buildRoom

source/ai/KeeperAI.cpp:532–544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

530}
531
532bool KeeperAI::buildRoom(RoomType roomType, int x, int y, int roomSize)
533{
534 std::vector<Tile*> tiles = mGameMap.getBuildableTilesForPlayerInArea(x, y, x + roomSize - 1,
535 y + roomSize - 1, &mPlayer);
536 if (tiles.size() < static_cast<uint32_t>(roomSize * roomSize))
537 return false;
538
539 if(!RoomManager::buildRoomOnTiles(&mGameMap, roomType, &mPlayer, tiles))
540 return false;
541
542 OD_LOG_INF("AI seatId=" + Helper::toString(mPlayer.getSeat()->getId())+ " builds room type=" + Helper::toString(static_cast<uint32_t>(roomType)) + ", x=" + Helper::toString(x) + ", y=" + Helper::toString(y) + ", roomSize=" + Helper::toString(roomSize));
543 return true;
544}
545
546bool KeeperAI::checkNeedRoom(RoomType roomType)
547{

Callers

nothing calls this directly

Calls 4

toStringFunction · 0.50
getIdMethod · 0.45
getSeatMethod · 0.45

Tested by

no test coverage detected