summaryrefslogtreecommitdiff
path: root/src/game-server/mapcomposite.hpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-10 14:17:38 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-10 14:17:38 +0000
commitf990980f80ab1523086edba1bed222741d716fa0 (patch)
tree0ce0257ca854ea06949f543227a301a7f553e1a9 /src/game-server/mapcomposite.hpp
parentcb45a65e1020bf129225dd20c57bf64314cef2c8 (diff)
downloadmanaserv-f990980f80ab1523086edba1bed222741d716fa0.tar.gz
manaserv-f990980f80ab1523086edba1bed222741d716fa0.tar.bz2
manaserv-f990980f80ab1523086edba1bed222741d716fa0.tar.xz
manaserv-f990980f80ab1523086edba1bed222741d716fa0.zip
Improved helper functions for Lua scripts. Associated scripts to maps.
Diffstat (limited to 'src/game-server/mapcomposite.hpp')
-rw-r--r--src/game-server/mapcomposite.hpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/game-server/mapcomposite.hpp b/src/game-server/mapcomposite.hpp
index 00d52173..fb86ee85 100644
--- a/src/game-server/mapcomposite.hpp
+++ b/src/game-server/mapcomposite.hpp
@@ -34,6 +34,7 @@ class Object;
class Character;
class Point;
class Rectangle;
+class Script;
class Thing;
struct MapContent;
@@ -129,8 +130,7 @@ class MapComposite
/**
* Constructor.
*/
- MapComposite(int id, std::string const &name)
- : mMap(NULL), mContent(NULL), mName(name), mID(id) {}
+ MapComposite(int id, std::string const &name);
/**
* Destructor.
@@ -150,6 +150,18 @@ class MapComposite
{ return mMap; }
/**
+ * Sets the associated script.
+ */
+ void setScript(Script *s)
+ { mScript = s; }
+
+ /**
+ * Gets the associated script.
+ */
+ Script *getScript() const
+ { return mScript; }
+
+ /**
* Returns whether the map is active on this server or not.
*/
bool isActive() const
@@ -217,10 +229,11 @@ class MapComposite
private:
MapComposite(MapComposite const &);
- Map *mMap; /**< Actual map. */
+ Map *mMap; /**< Actual map. */
MapContent *mContent; /**< Entities on the map. */
- std::string mName; /**< Name of the map. */
- unsigned short mID; /**< ID of the map. */
+ Script *mScript; /**< Script associated to this map. */
+ std::string mName; /**< Name of the map. */
+ unsigned short mID; /**< ID of the map. */
};
#endif