SmartFoxServer 2X C++ API
User.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of User interface
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2012 First version
9 //
10 // ===================================================================
11 #ifndef __User__
12 #define __User__
13 
14 namespace Sfs2X {
15 namespace Entities {
16  class User;
17 } // namespace Entities
18 } // namespace Sfs2X
19 
20 #include "../Util/Common.h"
21 #include "Variables/UserVariable.h"
22 #include "Managers/IUserManager.h"
23 #include "Room.h"
24 #include "Data/Vec3D.h"
25 
26 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
27 
28 using namespace Sfs2X::Entities::Managers;
29 using namespace Sfs2X::Entities::Data;
30 using namespace Sfs2X::Entities::Variables;
31 
32 #if defined(_MSC_VER)
33 #pragma warning(disable:4786) // STL library: disable warning 4786; this warning is generated due to a Microsoft bug
34 #endif
35 #include <string> // STL library: string object
36 #include <list> // STL library: list object
37 #include <vector> // STL library: vector object
38 #include <map> // STL library: map object
39 using namespace std; // STL library: declare the STL namespace
40 
41 using namespace Sfs2X::Entities::Variables;
42 
43 namespace Sfs2X {
44 namespace Entities {
45 
55  class DLLImportExport User
56  {
57  public:
58 
62  virtual long int Id() = 0;
63 
67  virtual boost::shared_ptr<string> Name() = 0;
68 
83  virtual long int PlayerId() = 0;
84 
92  virtual bool IsPlayer() = 0;
93 
101  virtual bool IsSpectator() = 0;
102 
116  virtual long int GetPlayerId (boost::shared_ptr<Room> room) = 0;
117 
118  virtual void SetPlayerId(long int id, boost::shared_ptr<Room> room) = 0;
119 
120  virtual void RemovePlayerId(boost::shared_ptr<Room> room) = 0;
121 
126  virtual long int PrivilegeId() = 0;
127 
132  virtual void PrivilegeId(long int value) = 0;
133 
138  virtual boost::shared_ptr<IUserManager> UserManager() = 0;
139 
144  virtual void UserManager(boost::shared_ptr<IUserManager> value) = 0;
145 
146  //--------------------------------------------------
147 
154  virtual bool IsGuest() = 0;
155 
162  virtual bool IsStandardUser() = 0;
163 
170  virtual bool IsModerator() = 0;
171 
178  virtual bool IsAdmin() = 0;
179  //--------------------------------------------------
180 
190  virtual bool IsPlayerInRoom(boost::shared_ptr<Room> room) = 0;
191 
201  virtual bool IsSpectatorInRoom(boost::shared_ptr<Room> room) = 0;
202 
212  virtual bool IsJoinedInRoom(boost::shared_ptr<Room> room) = 0;
213 
217  virtual bool IsItMe() = 0;
218 
226  virtual boost::shared_ptr<vector<boost::shared_ptr<UserVariable> > > GetVariables() = 0;
227 
238  virtual boost::shared_ptr<UserVariable> GetVariable(string varName) = 0;
239 
240  virtual void SetVariable(boost::shared_ptr<UserVariable> userVariable) = 0;
241 
242  virtual void SetVariables(boost::shared_ptr<vector<boost::shared_ptr<UserVariable> > > userVaribles) = 0;
243 
254  virtual bool ContainsVariable(string name) = 0;
255 
262  virtual boost::shared_ptr<map<string, boost::shared_ptr<void> > > Properties() = 0;
263 
270  virtual void Properties(boost::shared_ptr<map<string, boost::shared_ptr<void> > > value) = 0;
271 
283  virtual boost::shared_ptr<Vec3D> AOIEntryPoint() = 0;
284 
296  virtual void AOIEntryPoint(boost::shared_ptr<Vec3D>value) = 0;
297  };
298 
299 } // namespace Entities
300 } // namespace Sfs2X
301 
302 #endif
STL namespace.
Definition: IBuddyManager.h:32
The User interface defines all the methods and properties that an object representing a SmartFoxServe...
Definition: User.h:55
Definition: BaseVariable.cpp:15
Definition: SmartFox.cpp:24
Definition: ISFSArray.h:17