Rework the source so that battle is in its own thing to work on.
This commit is contained in:
parent
e6a8a8b338
commit
ca328e10dc
7 changed files with 69 additions and 57 deletions
19
rituals.hpp
19
rituals.hpp
|
@ -2,29 +2,10 @@
|
|||
#include "goap.hpp"
|
||||
#include "ai.hpp"
|
||||
#include "config.hpp"
|
||||
#include <functional>
|
||||
#include "dinkyecs.hpp"
|
||||
#include <optional>
|
||||
#include "components.hpp"
|
||||
|
||||
namespace combat {
|
||||
|
||||
struct BattleAction {
|
||||
DinkyECS::Entity entity;
|
||||
ai::EntityAI &ai;
|
||||
components::Combat &combat;
|
||||
};
|
||||
|
||||
struct BattleEngine {
|
||||
std::unordered_map<DinkyECS::Entity, BattleAction> combatants;
|
||||
std::vector<BattleAction> pending_actions;
|
||||
|
||||
void add_enemy(BattleAction ba);
|
||||
bool plan();
|
||||
std::optional<BattleAction> next();
|
||||
void dump();
|
||||
};
|
||||
|
||||
struct RitualAI {
|
||||
std::string script;
|
||||
ai::State start;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue