1 #ifndef CORE_SYSTEMS_INTERACTION_HPP
2 #define CORE_SYSTEMS_INTERACTION_HPP
4 #include <BLIB/ECS.hpp>
5 #include <BLIB/Events.hpp>
10 #include <unordered_map>
11 #include <unordered_set>
27 :
public bl::event::Listener<event::GameSaveInitializing, event::BattleCompleted> {
48 bool interact(bl::ecs::Entity interactor);
72 bool flagSet(
const std::string& flag)
const;
79 void setFlag(
const std::string& flag);
83 bl::ecs::Entity interactingEntity;
85 std::unordered_map<std::string, std::unordered_set<std::string>> talkedTo;
86 std::unordered_set<std::string> flags;
89 void processConversationNode();
90 void faceEntity(bl::ecs::Entity toRotate, bl::ecs::Entity toFace);
92 void continuePressed();
93 void failMessageFinished();
94 void choiceMade(
const std::string& choice);
95 void giveItemDecided(
const std::string& choice);
96 void giveMoneyDecided(
const std::string& choice);
100 void setTalked(
const std::string& name);
104 friend struct bl::serial::SerializableObject<
Interaction>;
Core classes and functionality for both the editor and game.
Wrapper around file::Conversation that tracks current node,.
Adding this to an entity will make it a trainer that can battle.
Fired when a battle finishes.
Fired when the game is saving or loading. Allows systems to hook in their data.
The main interaction system. Manages interaction between entities. Handles item logic and NPC convers...
void init()
Subscribes to the game event bus.
Interaction(Systems &owner)
Construct a new Interaction system.
bool flagSet(const std::string &flag) const
Checks if the given conversation flag has been set.
bool npcTalkedTo(const std::string &name) const
Returns whether or not the given npc has been talked to.
bool interact(bl::ecs::Entity interactor)
Performs an interation on behalf of the given entity.
bool trainerTalkedto(const std::string &name) const
Returns whether or not the given trainer has been talked to.
void setFlag(const std::string &flag)
Sets the conversation flag.
Owns all primary systems and a reference to the engine.