Labyrinth
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
aiagent.hpp
1 //////////////////////////////
2 //
3 // File: lxs/game/aiagent.hpp
4 // Author: Maciej Kaminski
5 // E-mail: maciej.a.kaminski@gmail.com
6 // Website: maciejkaminski.pl
7 //
8 // File creation date: May 27 2014
9 // This file is part of Project Labyrinth
10 // This file is going to be released under terms of GNU GPL in near future
11 //
12 //////////////////////////////
13 
14 #ifndef __LXS_AIA__
15 #define __LXS_AIA__
16 #include <vector>
17 #include <string>
18 //#include "lxs/game/character.hpp"
19 namespace LxS
20 {
21  namespace Game
22  {
23  class Dialogue;
24  class Character;
25  //! AI agent for computer controlled character
26  class AIAgent
27  {
28  Character * slave;
29  typedef std::vector<Dialogue*> Dialogues_t;
30 
31  Dialogues_t Dialogues;
32 
33  Dialogues_t::iterator current_dialogue_state;
34  public:
35  //! constructor - associated character must be given
36  AIAgent(Character * _s);//: slave(_s){}
37  //! perform actions that could have happened in dt time
38  void Animate(float dt);
39  //! is this NPC willing to talk?
40  bool IsWillingToTalk();
41 
42  //! What can NPC tell to this PC?
43  typedef std::vector<std::string> DialogueLines;
44 
45  //! what does the NPC say
46  std::string GetAnswer();
47 
48  //! What can PC say to this NPC right now?
50 
51  //! file containing statements and dialogue reaction
52  void SetDialoguesFile(std::string &dial_file);
53  //! say sentence s to this NPC character
54  void Say(std::string &s);
55  ~AIAgent();
56  };
57  }
58 }
59 #endif