You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
832 B
37 lines
832 B
#pragma once
|
|
#include "rituals.hpp"
|
|
#include "config.hpp"
|
|
#include "dinkyecs.hpp"
|
|
#include <optional>
|
|
#include "components.hpp"
|
|
|
|
namespace combat {
|
|
|
|
struct Combatant {
|
|
DinkyECS::Entity entity;
|
|
ai::EntityAI &ai;
|
|
components::Combat &combat;
|
|
};
|
|
|
|
enum class BattleAction {
|
|
ATTACK, BLOCK, ESCAPE
|
|
};
|
|
|
|
struct BattleResult {
|
|
Combatant &state;
|
|
BattleAction action;
|
|
};
|
|
|
|
struct BattleEngine {
|
|
std::unordered_map<DinkyECS::Entity, Combatant> combatants;
|
|
std::vector<BattleResult> pending_actions;
|
|
|
|
void add_enemy(Combatant ba);
|
|
bool plan();
|
|
std::optional<BattleResult> next();
|
|
void dump();
|
|
void set(DinkyECS::Entity entity, std::string state, bool setting);
|
|
void set_all(std::string state, bool setting);
|
|
void queue(DinkyECS::Entity entity, BattleAction action);
|
|
};
|
|
}
|
|
|