]>
jfr.im git - irc/gameservirc.git/blob - gameserv-2.0/libgameservgldl/include/GameServ/GameLayer/GameObjects/GameObject.h
1 #ifndef __GS__GAMEOBJECT_H__
2 #define __GS__GAMEOBJECT_H__
4 #include <GameServ/Types.h>
5 using GameServ::Types::ObjectTypes
;
10 using std::unary_function
;
12 #include <boost/smart_ptr/shared_ptr.hpp>
13 using boost::shared_ptr
;
15 namespace GameServ
{ namespace GameLayer
{ namespace GameObjects
21 GameObject(const string
&Id
);
22 virtual ~GameObject();
24 //! Returns the Id of this Game Object
25 string
Id(void) const;
26 //! Set the Id for this Game Object
27 void Id(const string
&value
);
29 //! Clone the entire game object
31 Overridden to allow deep cloning to prevent slicing.
32 \return Pointer to new Game object
34 virtual GameObject
*Clone(void) const = 0;
36 virtual ObjectTypes::ObjectType
ObjectType(void) const = 0;
38 bool operator==(const GameObject
&right
) const;
39 bool operator!=(const GameObject
&right
) const;
44 friend class GameObjectIds_Eq
;
47 //! Functor to compare Id's of Game Objects
48 class GameObjectIds_Eq
: public unary_function
<shared_ptr
<GameObject
>, bool>
51 explicit GameObjectIds_Eq(const string
&Id
);
53 //! Comparison against shared_ptr types
54 bool operator()(const shared_ptr
<GameObject
> &BO
) const;