diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-01-22 13:31:13 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-01-22 13:31:13 +0000 |
commit | bd56bf8afdab16383ed8ad08412a8c807f84af85 (patch) | |
tree | 0e963ada63bcbe3c50dd77986aaa15b9ba49816a /src/beingmanager.h | |
parent | 5359640b6f271af31f6423df9d661433eff89a3e (diff) | |
download | mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.gz mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.bz2 mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.xz mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.zip |
Merged NETWORK branch (includes BEING_OVERHAUL).
Diffstat (limited to 'src/beingmanager.h')
-rw-r--r-- | src/beingmanager.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/src/beingmanager.h b/src/beingmanager.h new file mode 100644 index 00000000..e50e804c --- /dev/null +++ b/src/beingmanager.h @@ -0,0 +1,88 @@ +/* + * the mana world + * copyright 2004 the mana world development team + * + * this file is part of the mana world. + * + * the mana world is free software; you can redistribute it and/or modify + * it under the terms of the gnu general public license as published by + * the free software foundation; either version 2 of the license, or + * any later version. + * + * the mana world is distributed in the hope that it will be useful, + * but without any warranty; without even the implied warranty of + * merchantability or fitness for a particular purpose. see the + * gnu general public license for more details. + * + * you should have received a copy of the gnu general public license + * along with the mana world; if not, write to the free software + * foundation, inc., 59 temple place, suite 330, boston, ma 02111-1307 usa + * + * $id: being.cpp,v 1.98 2005/12/25 01:28:03 b_lindeijer exp $ + */ + +#ifndef _TMW_BEINGMANAGER_H +#define _TMW_BEINGMANAGER_H + +#include "being.h" + +class LocalPlayer; +class Map; +class Network; + +typedef std::list<Being*> Beings; + +class BeingManager +{ + public: + BeingManager(Network *network); + + /** + * Sets the map on which beings are created + */ + void setMap(Map *map); + + /** + * Sets the current player + */ + void setPlayer(LocalPlayer *player); + + /** + * Create a being and add it to the list of beings + */ + Being* createBeing(Uint32 id, Uint16 job); + + /** + * Remove a Being + */ + void destroyBeing(Being *being); + + /** + * Return a specific id Being + */ + Being* findBeing(Uint32 id); + + /** + * Return a being at specific coordinates + */ + Being* findBeing(Uint16 x, Uint16 y, Being::Type type = Being::UNKNOWN); + + /** + * Returns the whole list of beings + */ + Beings* getAll(); + + /** + * Destroys all beings except the local player + */ + void clear(); + + protected: + Beings mBeings; + Map *mMap; + Network *mNetwork; +}; + +extern BeingManager *beingManager; + +#endif |