CvTacticalDominanceZone::GetZoneType() const
- Defined in
- CvTacticalAnalysisMap.cpp, line 137
- Class
- CvTacticalDominanceZone
- Hook name
CivHooks::CvTacticalDominanceZone_GetZoneType
Hooks
static bool BeforeCvTacticalDominanceZone_GetZoneType(const CvTacticalDominanceZone* self, TacticalMoveZoneType& result);static void AfterCvTacticalDominanceZone_GetZoneType(const CvTacticalDominanceZone* self, TacticalMoveZoneType& result);static TacticalMoveZoneType ReplaceCvTacticalDominanceZone_GetZoneType(TacticalMoveZoneType (*original)(const CvTacticalDominanceZone*), const CvTacticalDominanceZone* self);CivRegisterBefore<CivHooks::CvTacticalDominanceZone_GetZoneType>(host, &BeforeCvTacticalDominanceZone_GetZoneType);CivRegisterAfter<CivHooks::CvTacticalDominanceZone_GetZoneType>(host, &AfterCvTacticalDominanceZone_GetZoneType);CivRegisterReplace<CivHooks::CvTacticalDominanceZone_GetZoneType>(host, &ReplaceCvTacticalDominanceZone_GetZoneType);
Code
136/// Mix ownership of zone and who is dominant to get a unique classification for the zone137TacticalMoveZoneType CvTacticalDominanceZone::GetZoneType() const138{139 if(m_eTerritoryType == TACTICAL_TERRITORY_FRIENDLY)140 {141 if(m_eDominanceFlag == TACTICAL_DOMINANCE_FRIENDLY)142 {143 return AI_TACTICAL_MOVE_ZONE_FRIENDLY_WINNING;144 }145 else if(m_eDominanceFlag == TACTICAL_DOMINANCE_EVEN)146 {147 return AI_TACTICAL_MOVE_ZONE_FRIENDLY_EVEN;148 }149 else150 {151 return AI_TACTICAL_MOVE_ZONE_FRIENDLY_LOSING;152 }153 }154155 else if(m_eTerritoryType == TACTICAL_TERRITORY_ENEMY)156 {157 if(m_eDominanceFlag == TACTICAL_DOMINANCE_FRIENDLY)158 {159 return AI_TACTICAL_MOVE_ZONE_ENEMY_WINNING;160 }161 else if(m_eDominanceFlag == TACTICAL_DOMINANCE_EVEN)162 {163 return AI_TACTICAL_MOVE_ZONE_ENEMY_EVEN;164 }165 else166 {167 return AI_TACTICAL_MOVE_ZONE_ENEMY_LOSING;168 }169 }170171 else172 {173 return AI_TACTICAL_MOVE_ZONE_UNOWNED;174 }175}