summaryrefslogtreecommitdiff
path: root/src/state.h
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-06-17 10:29:02 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-06-17 10:29:02 +0000
commitb344d0f5f2b31e3b01f47fe3e3c57d41315fabf7 (patch)
treeca1d9be395c3934fd24c38f01f0099c7fa01be9b /src/state.h
parent6922c9e54bd495bd79ad5766fafcbff4e5565460 (diff)
downloadmanaserv-b344d0f5f2b31e3b01f47fe3e3c57d41315fabf7.tar.gz
manaserv-b344d0f5f2b31e3b01f47fe3e3c57d41315fabf7.tar.bz2
manaserv-b344d0f5f2b31e3b01f47fe3e3c57d41315fabf7.tar.xz
manaserv-b344d0f5f2b31e3b01f47fe3e3c57d41315fabf7.zip
Started handling beings on maps.
Diffstat (limited to 'src/state.h')
-rw-r--r--src/state.h45
1 files changed, 10 insertions, 35 deletions
diff --git a/src/state.h b/src/state.h
index 0c99afc5..2ebf8b1e 100644
--- a/src/state.h
+++ b/src/state.h
@@ -28,10 +28,6 @@
#include "being.h"
-#include "utils/singleton.h"
-
-class ConnectionHandler;
-
namespace tmwserv
{
class Map;
@@ -65,19 +61,16 @@ struct MapComposite {
* State class contains all information/procedures associated with the game
* world's state.
*/
-class State : public utils::Singleton<State>
+class State
{
- friend class utils::Singleton<State>;
-
- State() throw();
- ~State() throw();
-
/**
* List of maps
*/
std::map<unsigned int, MapComposite> maps;
public:
+ State();
+ ~State();
/**
* Update game state (contains core server logic)
@@ -87,7 +80,7 @@ class State : public utils::Singleton<State>
/**
* Add being to game world at specified map
*/
- void addBeing(BeingPtr beingPtr, const unsigned int mapId);
+ void addBeing(BeingPtr beingPtr);
/**
* Remove being from game world
@@ -95,46 +88,28 @@ class State : public utils::Singleton<State>
void removeBeing(BeingPtr beingPtr);
/**
- * Check to see if a map exists in game world
+ * Send game state to given being
*/
- bool mapExists(const unsigned int mapId);
-
- /**
- * Check if being exists in game world already
- */
- bool beingExists(BeingPtr beingPtr);
+ void informBeing(BeingPtr beingPtr);
/**
* Load map into game world
*/
- bool loadMap(const unsigned int mapId);
+ bool loadMap(unsigned mapId);
/**
* Add object to the map
*/
- void addObject(ObjectPtr objectPtr, const unsigned int mapId);
+ void addObject(ObjectPtr objectPtr);
/**
* Remove an object from the map
*/
void removeObject(ObjectPtr objectPtr);
-
- /**
- * Find out whether an object exists in the game world or not
- */
- bool objectExists(const ObjectPtr objectPtr);
-
- /**
- * Find map player in world is on
- */
- const unsigned int findPlayer(BeingPtr being);
-
- /**
- * Find map object in world is on
- */
- const unsigned int findObject(ObjectPtr objectPtr);
};
} // namespace tmwserv
+extern tmwserv::State * gameState;
+
#endif