]>
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__
6 using std::unary_function
;
8 #include <boost/shared_ptr.hpp>
9 using boost::shared_ptr
;
11 namespace GameServ
{ namespace GameLayer
{ namespace GameObjects
17 GameObject(const string
&Id
);
18 virtual ~GameObject();
20 //! Returns the Id of this Game Object
21 string
Id(void) const;
22 //! Set the Id for this Game Object
23 void Id(const string
&value
);
25 //! Clone the entire game object
27 Overridden to allow deep cloning to prevent slicing.
28 \return Pointer to new Game object
30 virtual GameObject
*Clone(void) const = 0;
32 bool operator==(const GameObject
&right
) const;
33 bool operator!=(const GameObject
&right
) const;
37 friend class GameObjectIds_Eq
;
40 //! Functor to compare Id's of Game Objects
41 class GameObjectIds_Eq
: public unary_function
<shared_ptr
<GameObject
>, bool>
44 explicit GameObjectIds_Eq(const string
&Id
);
46 //! Comparison against shared_ptr types
47 bool operator()(const shared_ptr
<GameObject
> &BO
) const;