MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / update

Method update

game/state/city/agentmission.cpp:304–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302}
303
304void AgentMission::update(GameState &state, Agent &a, unsigned int ticks, bool finished)
305{
306 finished = finished || isFinishedInternal(state, a);
307 switch (this->type)
308 {
309 case MissionType::GotoBuilding:
310 return;
311 case MissionType::InvestigateBuilding:
312 {
313 if (finished && this->targetBuilding->detected && a.owner == state.getPlayer())
314 {
315 this->targetBuilding->decreasePendingInvestigatorCount(state);
316 }
317 return;
318 }
319 case MissionType::RestartNextMission:
320 return;
321 case MissionType::AwaitPickup:
322 case MissionType::Snooze:
323 {
324 if (ticks >= this->timeToSnooze)
325 this->timeToSnooze = 0;
326 else
327 this->timeToSnooze -= ticks;
328 return;
329 }
330 default:
331 LogWarning("TODO: Implement update");
332 return;
333 }
334}
335
336bool AgentMission::isFinished(GameState &state, Agent &a, bool callUpdateIfFinished)
337{

Callers

nothing calls this directly

Calls 2

getPlayerMethod · 0.80

Tested by

no test coverage detected