YAPOG  0.0.1
Yet Another Pokemon Online Game
Chat.hpp
Go to the documentation of this file.
1 #ifndef YAPOG_CHAT_HPP
2 # define YAPOG_CHAT_HPP
3 
4 # include <iostream>
5 # include <sstream>
6 # include "YAPOG/Macros.hpp"
11 # include "YAPOG/System/IntTypes.hpp"
12 # include "YAPOG/System/String.hpp"
15 
16 namespace yap
17 {
19  {
21  public:
23  Chat ();
24  Chat (String b);
25  ~Chat ();
26 
27  // Parse chat line - Return a string if arrow up/down is pushed
28  String Parse ();
29  // Execute the line - Return chan number and a string to display
30  ResponseType Exec ();
31 
32  // Getter & Setter for buffer_
33  void SetBuf (String b);
34 
35  // Chat History
36  std::pair<bool, String> GetUpHistory ();
37  std::pair<bool, String> GetDownHistory ();
38  String GetStringHistory ();
39  BufferType GetBufHistory ();
40  BufferType GetHistory ();
41  bool GetIsCommand ();
42  bool ChangeChan (ChatDisplayer& display);
43 
44  String GetTabName (UInt32 TabNb);
45  UInt32 GetTabCount ();
46  UInt32 GetTabNb ();
47 
48  private:
49  void IncOff ();
50  // Check if the user's entry is a command
51  void Check ();
52  // Execute Echo
53  void ToEcho (String s);
54  // Test History
55  std::pair<bool, String> TestHistoryChecker ();
56 
59  size_t offset_;
66  bool isCommand_;
67  };
68 } // namespace yap
69 
70 #endif // YAPOG_CHAT_HPP