diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-08-26 19:26:39 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2006-08-26 19:26:39 +0000 |
commit | c8104aa3b53448a047a0ee01835a6f68ac62f23c (patch) | |
tree | 6b0d4bae6814355b44abb694204a0a80d29b6cb9 /src/object.h | |
parent | 30d192259e6913a210156da2abce16e05b5a5825 (diff) | |
download | manaserv-c8104aa3b53448a047a0ee01835a6f68ac62f23c.tar.gz manaserv-c8104aa3b53448a047a0ee01835a6f68ac62f23c.tar.bz2 manaserv-c8104aa3b53448a047a0ee01835a6f68ac62f23c.tar.xz manaserv-c8104aa3b53448a047a0ee01835a6f68ac62f23c.zip |
Improve updates when a being just appeared.
Diffstat (limited to 'src/object.h')
-rw-r--r-- | src/object.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/object.h b/src/object.h index 05b1f45d..ecd06985 100644 --- a/src/object.h +++ b/src/object.h @@ -43,6 +43,7 @@ class Object Object(int type, int id) : mType(type), mID(id), + mNew(true), mNeedUpdate(false) {} @@ -142,12 +143,25 @@ class Object void setMapId(unsigned int mapId) { mMapId = mapId; } + /** + * Tells if the object just appeared. + */ + bool isNew() const + { return mNew; } + + /** + * Sets the age of the object. + */ + void setNew(bool n) + { mNew = n; } + private: int mType; /**< Object type */ int mID; /** Object unique ID (wrt its type and its map at least) */ unsigned int mX; /**< x coordinate */ unsigned int mY; /**< y coordinate */ unsigned int mMapId; /**< id of the map being is on */ + bool mNew; /**< true if the object just appeared */ protected: bool mNeedUpdate; /**< update() must be invoked if true */ |