diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-29 14:30:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-29 14:30:20 +0300 |
commit | 0f9ec2061c4ad6157c3186f1cab9c4d8558980b5 (patch) | |
tree | 6259593b8436178ad8d981a96a8fd71eab9e04cc /src/actormanager.h | |
parent | 01773c71a4698c6f01fe70d864f922bda65506cb (diff) | |
download | plus-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.tar.gz plus-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.tar.bz2 plus-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.tar.xz plus-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.zip |
Add strong typed int type BeingId.
Diffstat (limited to 'src/actormanager.h')
-rw-r--r-- | src/actormanager.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/actormanager.h b/src/actormanager.h index 08e1d005e..073a5a025 100644 --- a/src/actormanager.h +++ b/src/actormanager.h @@ -27,6 +27,7 @@ #include "enums/simpletypes/allowsort.h" #include "enums/simpletypes/allplayers.h" +#include "enums/simpletypes/beingid.h" #include "enums/simpletypes/npcnames.h" #include "listeners/configlistener.h" @@ -68,7 +69,7 @@ class ActorManager final: public ConfigListener /** * Create a Being and add it to the list of ActorSprites. */ - Being *createBeing(const int id, + Being *createBeing(const BeingId id, const ActorType::Type type, const uint16_t subtype) A_WARN_UNUSED; @@ -79,9 +80,11 @@ class ActorManager final: public ConfigListener /** * Create a FloorItem and add it to the list of ActorSprites. */ - FloorItem *createItem(const int id, const int itemId, + FloorItem *createItem(const BeingId id, + const int itemId, const int x, const int y, - const int amount, const unsigned char color, + const int amount, + const unsigned char color, const int subX, const int subY); /** @@ -97,7 +100,7 @@ class ActorManager final: public ConfigListener /** * Returns a specific Being, by id; */ - Being *findBeing(const int id) const A_WARN_UNUSED; + Being *findBeing(const BeingId id) const A_WARN_UNUSED; /** * Returns a being at specific coordinates. @@ -127,7 +130,7 @@ class ActorManager final: public ConfigListener /** * Returns a specific FloorItem, by id. */ - FloorItem *findItem(const int id) const A_WARN_UNUSED; + FloorItem *findItem(const BeingId id) const A_WARN_UNUSED; /** * Returns a FloorItem at specific coordinates. @@ -223,11 +226,11 @@ class ActorManager final: public ConfigListener */ void clear(); - void addBlock(const uint32_t id); + void addBlock(const BeingId id); - void deleteBlock(const uint32_t id); + void deleteBlock(const BeingId id); - bool isBlocked(const uint32_t id) const; + bool isBlocked(const BeingId id) const; void printAllToChat() const; @@ -352,7 +355,7 @@ class ActorManager final: public ConfigListener ActorSprites mActors; ActorSprites mDeleteActors; - std::set<uint32_t> mBlockedBeings; + std::set<BeingId> mBlockedBeings; Map *mMap; std::string mSpellHeal1; std::string mSpellHeal2; |