| 138 | } |
| 139 | |
| 140 | static std::shared_ptr<Game_BattleAlgorithm::AlgorithmBase> MakeAction(Game_Enemy& enemy, const lcf::rpg::EnemyAction& action, bool emulate_bugs) { |
| 141 | switch (action.kind) { |
| 142 | case lcf::rpg::EnemyAction::Kind_basic: |
| 143 | return MakeBasicAction(enemy, action); |
| 144 | case lcf::rpg::EnemyAction::Kind_skill: |
| 145 | return MakeSkillAction(enemy, action, emulate_bugs); |
| 146 | case lcf::rpg::EnemyAction::Kind_transformation: |
| 147 | return std::make_shared<Game_BattleAlgorithm::Transform>(&enemy, action.enemy_id); |
| 148 | } |
| 149 | return nullptr; |
| 150 | } |
| 151 | |
| 152 | void SetEnemyAction(Game_Enemy& enemy, const lcf::rpg::EnemyAction& action, bool emulate_bugs) { |
| 153 | auto algo = MakeAction(enemy, action, emulate_bugs); |
no test coverage detected