Peoplemon  0.1.0
Peoplemon 3 game source documentation
Conversation.hpp
Go to the documentation of this file.
1 #ifndef CORE_AI_CONVERSATION_HPP
2 #define CORE_AI_CONVERSATION_HPP
3 
4 #include <BLIB/ECS/Entity.hpp>
6 
14 namespace core
15 {
16 namespace system
17 {
18 class Systems;
19 }
20 
22 namespace ai
23 {
28 class Conversation {
29 public:
36  Conversation(system::Systems& systems);
37 
46  void setConversation(const file::Conversation& conversation, bl::ecs::Entity entity,
47  bool talked);
48 
54 
59  bool finished() const;
60 
65  void notifyNext();
66 
71  void notifyCheckPassed();
72 
77  void notifyCheckFailed();
78 
84  void notifyChoiceMade(const std::string& choice);
85 
86 private:
87  system::Systems& systems;
88  bl::ecs::Entity entity;
89  const std::vector<file::Conversation::Node>* nodes;
90  unsigned int current;
91  bool alreadyTalked;
92 
93  void followNodes();
94 };
95 
96 } // namespace ai
97 } // namespace core
98 
99 #endif
Core classes and functionality for both the editor and game.
Wrapper around file::Conversation that tracks current node,.
void notifyNext()
Continues to the next node on player input.
bool finished() const
Returns whether or not the conversation is finished.
void notifyCheckFailed()
Jumps to the node for a check pass (ie take item/money fail etc)
void notifyCheckPassed()
Jumps to the node for a check pass (ie take item/money success etc)
void notifyChoiceMade(const std::string &choice)
Jumps to the node for the given choice if the current node is a Prompt.
const file::Conversation::Node & currentNode() const
Returns the current node.
Conversation(system::Systems &systems)
Creates an empty conversation wrapper.
void setConversation(const file::Conversation &conversation, bl::ecs::Entity entity, bool talked)
Sets the wrapper to point to the given underlying. The underlying must remain in scope during the lif...
Stores a conversation that an NPC or trainer can have with the player.
Building block of conversations. A conversation is a tree of nodes and each node is an action that ha...
Owns all primary systems and a reference to the engine.
Definition: Systems.hpp:47