Initial battle engine is now integrated in the systems so now I can finally get the turn based combat to work the way I envision.
This commit is contained in:
parent
e18aeaf05c
commit
1f90367f51
10 changed files with 80 additions and 81 deletions
17
rituals.hpp
17
rituals.hpp
|
@ -4,15 +4,24 @@
|
|||
#include "config.hpp"
|
||||
#include <functional>
|
||||
#include "dinkyecs.hpp"
|
||||
#include <optional>
|
||||
#include "components.hpp"
|
||||
|
||||
namespace combat {
|
||||
|
||||
struct BattleEngine {
|
||||
std::unordered_map<DinkyECS::Entity, ai::EntityAI&> combatants;
|
||||
struct BattleAction {
|
||||
DinkyECS::Entity entity;
|
||||
ai::EntityAI &ai;
|
||||
components::Combat &combat;
|
||||
};
|
||||
|
||||
void add_enemy(DinkyECS::Entity enemy_id, ai::EntityAI& enemy);
|
||||
struct BattleEngine {
|
||||
std::unordered_map<DinkyECS::Entity, BattleAction> combatants;
|
||||
std::vector<BattleAction> pending_actions;
|
||||
|
||||
void add_enemy(BattleAction ba);
|
||||
bool plan();
|
||||
void fight(std::function<void(DinkyECS::Entity, ai::EntityAI &)> cb);
|
||||
std::optional<BattleAction> next();
|
||||
void dump();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue