YAPOG  0.0.1
Yet Another Pokemon Online Game
ChatCommand.hpp
Go to the documentation of this file.
1 #ifndef YAPOG_CHATCOMMAND_HPP
2 # define YAPOG_CHATCOMMAND_HPP
3 
4 # include <iostream>
5 # include <sstream>
8 # include "YAPOG/Macros.hpp"
10 # include "YAPOG/System/String.hpp"
12 
13 # define NBCMDS 3
14 # define NBCMDSLOC 4
15 # define NBTOTCMDS (NBCMDS + NBCMDSLOC)
16 
17 namespace yap
18 {
19  class Chat;
20  class ChatDisplayer;
21  typedef BufferType (ChatCommand::*funcloc) (UInt32* channb,
22  BufferType* b,
23  ChatManager* cm,
24  ChatDisplayer* cd);
25 
27  {
29  public:
30  typedef struct MyCmd
31  {
35  } MyCmdType;
36  ChatCommand ();
37  ~ChatCommand ();
38 
39  // Commands
40  // With request
41  DisplayType Trade (BufferType b);
42  DisplayType Echo (BufferType b);
43  // Without request
44  DisplayType Help (BufferType b);
45  DisplayType SwitchTab (BufferType b);
46  DisplayType SwitchChan (BufferType b);
47  DisplayType AddChan (BufferType b);
48  DisplayType RmChan (BufferType b);
49  DisplayType Unknown (BufferType b);
50 
51  // Set the command
52  void SetCommand (func cmd);
53  // Get the command
54  func GetCmd (const char *pString);
55  // Execute the command
56  ResponseType ExecCmd (ChatManagerType* cm);
57 
58  private:
59  BufferType SwitchTab (
60  UInt32* channb,
61  BufferType* b,
62  ChatManagerType* cm,
63  ChatDisplayer* cd);
64 
65  BufferType SwitchChan
66  (UInt32* channb,
67  BufferType* b,
68  ChatManagerType* cm,
69  ChatDisplayer* cd);
70 
71  BufferType AddChan (
72  UInt32* channb,
73  BufferType* b,
74  ChatManagerType* cm,
75  ChatDisplayer* cd);
76 
77  BufferType RmChan (
78  UInt32* channb,
79  BufferType* b,
80  ChatManagerType* cm,
81  ChatDisplayer* cd);
82 
85  };
86 } // namespace yap
87 
88 #endif // YAPOG_CHATCOMMAND_HPP