summaryrefslogtreecommitdiff
path: root/src/floor_item.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-10-07 00:12:32 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-10-07 00:12:32 +0000
commita246c08cef5e4d598fc07a681eb971bfbcf01519 (patch)
treeff1813b11379ddef2c5be627aafcf3329170a293 /src/floor_item.h
parent09db562f2fca5c49fa1a92ba0b6dc60db479ae08 (diff)
downloadmana-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/floor_item.h')
-rwxr-xr-xsrc/floor_item.h39
1 files changed, 23 insertions, 16 deletions
diff --git a/src/floor_item.h b/src/floor_item.h
index cd3293b4..5563da24 100755
--- a/src/floor_item.h
+++ b/src/floor_item.h
@@ -21,8 +21,12 @@
* $Id$
*/
-#ifndef _TMW_FLOORITEM_H
-#define _TMW_FLOORITEM_H
+#ifndef _TMW_FLOORITEM_H_
+#define _TMW_FLOORITEM_H_
+
+class Map;
+
+#include "map.h"
/**
* An item lying on the floor.
@@ -36,38 +40,41 @@ class FloorItem
FloorItem(unsigned int id,
unsigned int itemId,
unsigned short x,
- unsigned short y):
- id(itemId),
- int_id(id),
- x(x),
- y(y)
- {
- }
+ unsigned short y,
+ Map *map);
+
+ /**
+ * Destructor.
+ */
+ ~FloorItem();
/**
* Returns instance id of this item.
*/
- unsigned int getId() { return int_id; }
+ unsigned int getId() { return mId; }
/**
* Returns the item id.
*/
- unsigned int getItemId() { return id; }
+ unsigned int getItemId() { return mItemId; }
/**
* Returns the x coordinate.
*/
- unsigned short getX() { return x; }
+ unsigned short getX() { return mX; }
/**
* Returns the y coordinate.
*/
- unsigned short getY() { return y; }
+ unsigned short getY() { return mY; }
private:
- unsigned int id;
- unsigned int int_id;
- unsigned short x, y;
+ unsigned int mId;
+ unsigned int mItemId;
+ unsigned short mX, mY;
+ Sprite *mSprite;
+ Sprites::iterator mSpriteIterator;
+ Map *mMap;
};
/** Removes all items from the list */