From 9f1994182d4225f630a93ae06b01927c4f7a9a37 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 29 May 2015 20:33:10 +0300 Subject: Convert ActorType enum into strong typed enum. --- src/actormanager.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/actormanager.cpp') diff --git a/src/actormanager.cpp b/src/actormanager.cpp index 8c7d48752..121f5e3f3 100644 --- a/src/actormanager.cpp +++ b/src/actormanager.cpp @@ -93,7 +93,7 @@ class FindBeingFunctor final } uint16_t x, y; - ActorType::Type type; + ActorTypeT type; } beingActorFinder; class FindBeingEqualFunctor final @@ -239,7 +239,7 @@ void ActorManager::setPlayer(LocalPlayer *const player) } Being *ActorManager::createBeing(const BeingId id, - const ActorType::Type type, + const ActorTypeT type, const BeingTypeId subtype) { Being *const being = new Being(id, type, subtype, mMap); @@ -344,7 +344,7 @@ Being *ActorManager::findBeing(const BeingId id) const } Being *ActorManager::findBeing(const int x, const int y, - const ActorType::Type type) const + const ActorTypeT type) const { beingActorFinder.x = static_cast(x); beingActorFinder.y = static_cast(y); @@ -726,7 +726,7 @@ bool ActorManager::pickUpNearest(const int x, const int y, } Being *ActorManager::findBeingByName(const std::string &name, - const ActorType::Type type) const + const ActorTypeT type) const { for_actorsm { @@ -750,7 +750,7 @@ Being *ActorManager::findBeingByName(const std::string &name, } Being *ActorManager::findNearestByName(const std::string &name, - const ActorType::Type &type) const + const ActorTypeT &type) const { if (!localPlayer) return nullptr; @@ -826,7 +826,7 @@ void ActorManager::logic() if (!actor) continue; - const ActorType::Type &type = actor->getType(); + const ActorTypeT &type = actor->getType(); if (type == ActorType::Player) { const Being *const being = static_cast(actor); @@ -880,7 +880,7 @@ void ActorManager::clear() Being *ActorManager::findNearestLivingBeing(const int x, const int y, const int maxTileDist, - const ActorType::Type type, + const ActorTypeT type, const Being *const excluded) const { const int maxDist = maxTileDist * mapTileSize; @@ -894,7 +894,7 @@ Being *ActorManager::findNearestLivingBeing(const int x, const int y, Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing, const int maxDist, - const ActorType::Type type, + const ActorTypeT type, const AllowSort allowSort) const { if (!aroundBeing) @@ -911,7 +911,7 @@ Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing, Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing, int maxDist, - const ActorType::Type &type, + const ActorTypeT &type, const int x, const int y, const Being *const excluded, const AllowSort allowSort) const @@ -1178,7 +1178,7 @@ Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing, bool ActorManager::validateBeing(const Being *const aroundBeing, Being *const being, - const ActorType::Type &type, + const ActorTypeT &type, const Being* const excluded, const int maxCost) const { -- cgit v1.2.3-60-g2f50