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.cpp | |
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.cpp')
-rw-r--r-- | src/actormanager.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/actormanager.cpp b/src/actormanager.cpp index fb1217e87..4544e445f 100644 --- a/src/actormanager.cpp +++ b/src/actormanager.cpp @@ -238,7 +238,7 @@ void ActorManager::setPlayer(LocalPlayer *const player) socialWindow->updatePickupFilter(); } -Being *ActorManager::createBeing(const int id, +Being *ActorManager::createBeing(const BeingId id, const ActorType::Type type, const uint16_t subtype) { @@ -280,7 +280,8 @@ Being *ActorManager::createBeing(const int id, return being; } -FloorItem *ActorManager::createItem(const int id, const int itemId, +FloorItem *ActorManager::createItem(const BeingId id, + const int itemId, const int x, const int y, const int amount, const unsigned char color, @@ -327,7 +328,7 @@ void ActorManager::undelete(const ActorSprite *const actor) } } -Being *ActorManager::findBeing(const int id) const +Being *ActorManager::findBeing(const BeingId id) const { for_actors { @@ -539,7 +540,7 @@ Being *ActorManager::findPortalByTile(const int x, const int y) const return nullptr; } -FloorItem *ActorManager::findItem(const int id) const +FloorItem *ActorManager::findItem(const BeingId id) const { for_actorsm { @@ -1337,17 +1338,17 @@ bool ActorManager::hasActorSprite(const ActorSprite *const actor) const return false; } -void ActorManager::addBlock(const uint32_t id) +void ActorManager::addBlock(const BeingId id) { mBlockedBeings.insert(id); } -void ActorManager::deleteBlock(const uint32_t id) +void ActorManager::deleteBlock(const BeingId id) { mBlockedBeings.erase(id); } -bool ActorManager::isBlocked(const uint32_t id) const +bool ActorManager::isBlocked(const BeingId id) const { return mBlockedBeings.find(id) != mBlockedBeings.end(); } @@ -1795,7 +1796,8 @@ Being *ActorManager::cloneBeing(const Being *const srcBeing, const int dx, const int dy, const int id) { - Being *const dstBeing = actorManager->createBeing(srcBeing->getId() + id, + Being *const dstBeing = actorManager->createBeing(fromInt( + toInt(srcBeing->getId(), int) + id, BeingId), ActorType::Player, srcBeing->getSubType()); if (!dstBeing) |