From eff4da1d0353140eb50e925b20a9071c58acd991 Mon Sep 17 00:00:00 2001 From: ArseniyShestakov Date: Mon, 9 Mar 2015 01:45:39 +0300 Subject: [PATCH] ETeleportChannelType: is now strongly typed enumeration --- lib/CGameInfoCallback.cpp | 2 +- lib/CGameInfoCallback.h | 2 +- lib/GameConstants.h | 15 ++++++--------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/CGameInfoCallback.cpp b/lib/CGameInfoCallback.cpp index b17d1b096..404cbe3fe 100644 --- a/lib/CGameInfoCallback.cpp +++ b/lib/CGameInfoCallback.cpp @@ -716,7 +716,7 @@ std::vector CGameInfoCallback::getTeleportChannelExits(Telepor return ret; } -ETeleportChannelType::ETeleportChannelType CGameInfoCallback::getTeleportChannelType(TeleportChannelID id, PlayerColor Player) const +ETeleportChannelType CGameInfoCallback::getTeleportChannelType(TeleportChannelID id, PlayerColor Player) const { std::vector entrances = getTeleportChannelEntraces(id, ObjectInstanceID(), Player); std::vector exits = getTeleportChannelExits(id, ObjectInstanceID(), Player); diff --git a/lib/CGameInfoCallback.h b/lib/CGameInfoCallback.h index 17383d7b8..4eef7bd7b 100644 --- a/lib/CGameInfoCallback.h +++ b/lib/CGameInfoCallback.h @@ -111,7 +111,7 @@ public: //teleport std::vector getTeleportChannelEntraces(TeleportChannelID id, ObjectInstanceID excludeId = ObjectInstanceID(), PlayerColor Player = PlayerColor::UNFLAGGABLE) const; std::vector getTeleportChannelExits(TeleportChannelID id, ObjectInstanceID excludeId = ObjectInstanceID(), PlayerColor Player = PlayerColor::UNFLAGGABLE) const; - ETeleportChannelType::ETeleportChannelType getTeleportChannelType(TeleportChannelID id, PlayerColor Player = PlayerColor::UNFLAGGABLE) const; + ETeleportChannelType getTeleportChannelType(TeleportChannelID id, PlayerColor Player = PlayerColor::UNFLAGGABLE) const; bool isTeleportEntrancePassable(const CGTeleport * obj, PlayerColor Player) const; }; diff --git a/lib/GameConstants.h b/lib/GameConstants.h index f39e2be73..efbbf1d9f 100644 --- a/lib/GameConstants.h +++ b/lib/GameConstants.h @@ -474,16 +474,13 @@ namespace ETileType }; } -namespace ETeleportChannelType +enum class ETeleportChannelType { - enum ETeleportChannelType - { - IMPASSABLE, - BIDIRECTIONAL, - UNIDIRECTIONAL, - MIXED - }; -} + IMPASSABLE, + BIDIRECTIONAL, + UNIDIRECTIONAL, + MIXED +}; class Obj {