| 302 | } |
| 303 | |
| 304 | void 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 | |
| 336 | bool AgentMission::isFinished(GameState &state, Agent &a, bool callUpdateIfFinished) |
| 337 | { |
nothing calls this directly
no test coverage detected