Refactored rituals so they can be used in different situations.
This commit is contained in:
parent
5af9a6664e
commit
da273cbee6
8 changed files with 123 additions and 66 deletions
22
rituals.hpp
22
rituals.hpp
|
@ -1,5 +1,7 @@
|
|||
#pragma once
|
||||
#include "goap.hpp"
|
||||
#include "ai.hpp"
|
||||
#include "config.hpp"
|
||||
|
||||
namespace combat {
|
||||
struct RitualAI {
|
||||
|
@ -16,11 +18,25 @@ namespace combat {
|
|||
|
||||
RitualAI() {};
|
||||
|
||||
void reset();
|
||||
bool will_do(std::string name);
|
||||
void set_state(std::string name, bool setting);
|
||||
void update();
|
||||
void dump();
|
||||
ai::Action pop();
|
||||
};
|
||||
|
||||
struct RitualEngine {
|
||||
Config $config;
|
||||
ai::AIProfile $profile;
|
||||
std::unordered_map<std::string, ai::Action> $actions;
|
||||
std::unordered_map<std::string, ai::State> $states;
|
||||
std::unordered_map<std::string, std::vector<ai::Action>> $scripts;
|
||||
|
||||
RitualEngine(std::string config_path);
|
||||
|
||||
ai::State load_state(std::string name);
|
||||
ai::Action load_action(std::string name);
|
||||
RitualAI start();
|
||||
void reset(RitualAI& ritual);
|
||||
void set_state(RitualAI& ritual, std::string name, bool setting);
|
||||
void plan(RitualAI& ritual);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue