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

Method doTurn

source/ai/KeeperAI.cpp:76–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76bool KeeperAI::doTurn(double timeSinceLastTurn)
77{
78 // If we have no dungeon temple, we are dead
79 if(getDungeonTemple() == nullptr)
80 return false;
81
82 if(!mIsFirstUpkeepDone)
83 {
84 mIsFirstUpkeepDone = true;
85 handleFirstTurn();
86 }
87
88 saveWoundedCreatures();
89
90 handleDefense();
91
92 if (handleWorkers())
93 return true;
94
95 if (checkTreasury())
96 return true;
97
98 if (handleRooms())
99 return true;
100
101 if (lookForGold())
102 return true;
103
104 if (repairRooms())
105 return true;
106
107 if(handleTiredCreatures())
108 return true;
109
110 if(handleHungryCreatures())
111 return true;
112
113 return true;
114}
115
116bool KeeperAI::checkTreasury()
117{

Callers 1

startNewTurnMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected