diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2011-10-08 11:19:44 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-10-15 00:10:22 +0200 |
commit | 1e6b7a30b7232dce7b8240441bed04912e06f666 (patch) | |
tree | b5aa2d893c2bee4268a3cfc8172dc6ae7ea6ce09 /src/game-server/map.cpp | |
parent | 9cd09f012ff7c01fbd51b972f9b716cfc8246b2c (diff) | |
download | manaserv-1e6b7a30b7232dce7b8240441bed04912e06f666.tar.gz manaserv-1e6b7a30b7232dce7b8240441bed04912e06f666.tar.bz2 manaserv-1e6b7a30b7232dce7b8240441bed04912e06f666.tar.xz manaserv-1e6b7a30b7232dce7b8240441bed04912e06f666.zip |
Added script bindings for reading map objects
map_get_objects([string filter]): returns all object of the current map optionally filtered by type.
map_get_object_property(handle object, string key): returns the value of the property of the object.
map_get_object_bounds(handle object): returns x, y, width, height of an object.
map_get_object_name(handle object): returns name of an object.
map_get_object_type(handle object): returns type of an object.
Mantis-issue: 397
Reviewed-by: Thorbjørn Lindeijer
Diffstat (limited to 'src/game-server/map.cpp')
-rw-r--r-- | src/game-server/map.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/game-server/map.cpp b/src/game-server/map.cpp index b824aaac..e372f03d 100644 --- a/src/game-server/map.cpp +++ b/src/game-server/map.cpp @@ -96,7 +96,6 @@ class Location int Fcost; /**< Estimation of total path cost */ }; - Map::Map(int width, int height, int tileWidth, int tileHeight): mWidth(width), mHeight(height), mTileWidth(tileWidth), mTileHeight(tileHeight), @@ -104,6 +103,15 @@ Map::Map(int width, int height, int tileWidth, int tileHeight): { } +Map::~Map() +{ + for (std::vector<MapObject*>::iterator it = mMapObjects.begin(); + it != mMapObjects.end(); ++it) + { + delete *it; + } +} + void Map::setSize(int width, int height) { mWidth = width; |