Index: ps/trunk/source/simulation2/components/ICmpRangeManager.h =================================================================== --- ps/trunk/source/simulation2/components/ICmpRangeManager.h +++ ps/trunk/source/simulation2/components/ICmpRangeManager.h @@ -352,7 +352,6 @@ virtual ELosVisibility GetLosVisibilityPosition(entity_pos_t x, entity_pos_t z, player_id_t player) const = 0; /** - /** * Request the update of the visibility cache of ent at next turn. * Typically used for fogging. */ Index: ps/trunk/source/simulation2/components/ICmpRangeManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpRangeManager.cpp +++ ps/trunk/source/simulation2/components/ICmpRangeManager.cpp @@ -21,28 +21,27 @@ #include "simulation2/system/InterfaceScripted.h" -std::string ICmpRangeManager::GetLosVisibility_wrapper(entity_id_t ent, int player) const -{ - ELosVisibility visibility = GetLosVisibility(ent, player); - switch (visibility) +namespace { + std::string VisibilityToString(ICmpRangeManager::ELosVisibility visibility) { - case VIS_HIDDEN: return "hidden"; - case VIS_FOGGED: return "fogged"; - case VIS_VISIBLE: return "visible"; - default: return "error"; // should never happen + switch (visibility) + { + case ICmpRangeManager::VIS_HIDDEN: return "hidden"; + case ICmpRangeManager::VIS_FOGGED: return "fogged"; + case ICmpRangeManager::VIS_VISIBLE: return "visible"; + default: return "error"; // should never happen + } } } +std::string ICmpRangeManager::GetLosVisibility_wrapper(entity_id_t ent, int player) const +{ + return VisibilityToString(GetLosVisibility(ent, player)); +} + std::string ICmpRangeManager::GetLosVisibilityPosition_wrapper(entity_pos_t x, entity_pos_t z, int player) const { - ELosVisibility visibility = GetLosVisibilityPosition(x, z, player); - switch (visibility) - { - case VIS_HIDDEN: return "hidden"; - case VIS_FOGGED: return "fogged"; - case VIS_VISIBLE: return "visible"; - default: return "error"; // should never happen - } + return VisibilityToString(GetLosVisibilityPosition(x, z, player)); } BEGIN_INTERFACE_WRAPPER(RangeManager)