| 4186 | } |
| 4187 | |
| 4188 | void BattleUnit::executeGroupAIDecision(GameState &state, AIDecision &decision, |
| 4189 | std::list<StateRef<BattleUnit>> &units) |
| 4190 | { |
| 4191 | if (units.size() == 1) |
| 4192 | { |
| 4193 | units.front()->executeAIDecision(state, decision); |
| 4194 | return; |
| 4195 | } |
| 4196 | if (decision.action) |
| 4197 | { |
| 4198 | for (auto &u : units) |
| 4199 | { |
| 4200 | u->executeAIAction(state, *decision.action); |
| 4201 | } |
| 4202 | } |
| 4203 | if (decision.movement) |
| 4204 | { |
| 4205 | switch (decision.movement->type) |
| 4206 | { |
| 4207 | case AIMovement::Type::Patrol: |
| 4208 | // Stance change |
| 4209 | for (auto &u : units) |
| 4210 | { |
| 4211 | u->setKneelingMode(decision.movement->kneelingMode); |
| 4212 | u->setMovementMode(decision.movement->movementMode); |
| 4213 | } |
| 4214 | state.current_battle->groupMove(state, units, decision.movement->targetLocation); |
| 4215 | break; |
| 4216 | default: |
| 4217 | for (auto &u : units) |
| 4218 | { |
| 4219 | u->executeAIMovement(state, *decision.movement); |
| 4220 | } |
| 4221 | break; |
| 4222 | } |
| 4223 | } |
| 4224 | } |
| 4225 | |
| 4226 | void BattleUnit::executeAIDecision(GameState &state, AIDecision &decision) |
| 4227 | { |
nothing calls this directly
no test coverage detected