SmartFoxServer 2X C++ API
MMOItem.h
1 // ===================================================================
2 //
3 // Description
4 // Contains the definition of MMOItem
5 //
6 // Revision history
7 // Date Description
8 // 30-Nov-2013 First version
9 //
10 // ===================================================================
11 #ifndef __MMOItem__
12 #define __MMOItem__
13 
14 #include "../Util/Common.h"
15 #include "IMMOItem.h"
16 #include "Variables/IMMOItemVariable.h"
17 #include "Data/Vec3D.h"
18 
19 #include <boost/shared_ptr.hpp> // Boost Asio shared pointer
20 
21 #if defined(_MSC_VER)
22 #pragma warning(disable:4786) // STL library: disable warning 4786; this warning is generated due to a Microsoft bug
23 #endif
24 #include <string> // STL library: string object
25 #include <vector> // STL library: vector object
26 #include <map> // STL library: map object
27 using namespace std; // STL library: declare the STL namespace
28 
29 using namespace Sfs2X::Entities::Variables;
30 using namespace Sfs2X::Entities::Data;
31 
32 namespace Sfs2X {
33 namespace Entities {
34 
51  class DLLImportExport MMOItem : public IMMOItem
52  {
53  public:
54 
55  // -------------------------------------------------------------------
56  // Public methods
57  // -------------------------------------------------------------------
58 
60  MMOItem (long int id);
61 
62  virtual ~MMOItem();
63 
64  virtual void Dispose();
65 
67  static boost::shared_ptr<IMMOItem> FromSFSArray(boost::shared_ptr<ISFSArray> encodedItem);
68 
70  virtual long int Id();
71 
73  virtual boost::shared_ptr<vector<boost::shared_ptr<IMMOItemVariable> > > GetVariables();
74 
76  virtual boost::shared_ptr<IMMOItemVariable> GetVariable(string name);
77 
79  virtual void SetVariable(boost::shared_ptr<IMMOItemVariable> variable);
80 
82  virtual void SetVariables(boost::shared_ptr<vector<boost::shared_ptr<IMMOItemVariable> > > variables);
83 
85  virtual bool ContainsVariable(string name);
86 
88  virtual boost::shared_ptr<Vec3D> AOIEntryPoint();
89  virtual void AOIEntryPoint(boost::shared_ptr<Vec3D> value);
90 
91  // -------------------------------------------------------------------
92  // Public members
93  // -------------------------------------------------------------------
94 
95  protected:
96 
97  // -------------------------------------------------------------------
98  // Protected methods
99  // -------------------------------------------------------------------
100 
101  // -------------------------------------------------------------------
102  // Protected members
103  // -------------------------------------------------------------------
104 
105  private:
106 
107  // -------------------------------------------------------------------
108  // Private methods
109  // -------------------------------------------------------------------
110 
111  // -------------------------------------------------------------------
112  // Private members
113  // -------------------------------------------------------------------
114  long int id;
115  boost::shared_ptr<Vec3D> aoiEntryPoint;
116  boost::shared_ptr<map<string, boost::shared_ptr<IMMOItemVariable> > > variables;
117  };
118 
119 } // namespace Entities
120 } // namespace Sfs2X
121 
122 #endif
The IMMOItem interface defines all the methods and properties that an object representing a SmartFoxS...
Definition: IMMOItem.h:42
STL namespace.
Definition: BaseVariable.cpp:15
An MMOItem object represents an active non-player entity inside an MMORoom.
Definition: MMOItem.h:51
Definition: SmartFox.cpp:24
Definition: ISFSArray.h:17