diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-10-07 00:12:32 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-10-07 00:12:32 +0000 |
commit | a246c08cef5e4d598fc07a681eb971bfbcf01519 (patch) | |
tree | ff1813b11379ddef2c5be627aafcf3329170a293 /src/map.h | |
parent | 09db562f2fca5c49fa1a92ba0b6dc60db479ae08 (diff) | |
download | mana-a246c08cef5e4d598fc07a681eb971bfbcf01519.tar.gz mana-a246c08cef5e4d598fc07a681eb971bfbcf01519.tar.bz2 mana-a246c08cef5e4d598fc07a681eb971bfbcf01519.tar.xz mana-a246c08cef5e4d598fc07a681eb971bfbcf01519.zip |
Modified finding NPC as by timonator's suggestion in order to allow NPCs to be
clicked on their heads too. Also made start to tile engine improvement by
adding the Sprite class that is now used by the floor items for being displayed
on the map. Finally added documentation to Item class and splitted out
Properties class from Map.
Diffstat (limited to 'src/map.h')
-rw-r--r-- | src/map.h | 31 |
1 files changed, 15 insertions, 16 deletions
@@ -21,20 +21,25 @@ * $Id$ */ -#ifndef _TMW_MAP_H -#define _TMW_MAP_H +#ifndef _TMW_MAP_H_ +#define _TMW_MAP_H_ #include <list> #include <map> #include <vector> +#include "properties.h" class Being; class Graphics; class Image; class Tileset; +class Sprite; struct PATH_NODE; +typedef std::vector<Tileset*> Tilesets; +typedef std::list<Sprite*> Sprites; + /** * A meta tile stores additional information about a location on a tile map. * This is information that doesn't need to be repeated for each tile in each @@ -81,7 +86,7 @@ class Location /** * A tile map. */ -class Map +class Map : public Properties { public: /** @@ -178,22 +183,16 @@ class Map findPath(int startX, int startY, int destX, int destY); /** - * Get a map property. - * - * @return the value of the given property or an empty string when it - * doesn't exist. + * Adds a sprite to the map. */ - std::string getProperty(const std::string &name); + Sprites::iterator + addSprite(Sprite *sprite); /** - * Returns whether a certain property is available. + * Removes a sprite from the map. */ - bool hasProperty(const std::string &name); - - /** - * Set a map property. - */ - void setProperty(const std::string &name, const std::string &value); + void + removeSprite(Sprites::iterator iterator); private: /** @@ -215,8 +214,8 @@ class Map Image **tiles; std::map<std::string,std::string> properties; - typedef std::vector<Tileset*> Tilesets; Tilesets tilesets; + Sprites mSprites; // Pathfinding members int onClosedList, onOpenList; |