Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

AI::Player::CityLessThreatened Class Reference

Collaboration diagram for AI::Player::CityLessThreatened:

Collaboration graph
[legend]
List of all members.

Detailed Description

compare two cities to see which is less threatened.

Definition at line 84 of file AI.h.

Public Methods

 CityLessThreatened (ThreatMap &tm, Map::WorldMap &wm)
BOOL operator() (City *c1, City *c2) const

Public Attributes

ThreatMapm_threatMap
Map::WorldMapm_worldMap


Constructor & Destructor Documentation

AI::Player::CityLessThreatened::CityLessThreatened ThreatMap   tm,
Map::WorldMap   wm
 

Definition at line 118 of file AI.cpp.

00118                                                                             :
00119     m_threatMap(tm), m_worldMap(wm) { }


Member Function Documentation

BOOL AI::Player::CityLessThreatened::operator() City   c1,
City   c2
const
 

Definition at line 122 of file AI.cpp.

References Int2Tuple::a, Int2Tuple::b, m_threatMap, m_worldMap, City::position(), and Map::WorldMap::worldToGridCoord().

00123   {
00124     Int2Tuple c1Coords = m_worldMap.worldToGridCoord(c1->position());
00125     Int2Tuple c2Coords = m_worldMap.worldToGridCoord(c2->position());
00126     return m_threatMap[c1Coords.a][c1Coords.b] < m_threatMap[c2Coords.a][c2Coords.b];
00127   }


Member Data Documentation

ThreatMap& AI::Player::CityLessThreatened::m_threatMap
 

Definition at line 90 of file AI.h.

Referenced by operator()().

Map::WorldMap& AI::Player::CityLessThreatened::m_worldMap
 

Definition at line 91 of file AI.h.

Referenced by operator()().


The documentation for this class was generated from the following files:
Generated on Wed Apr 23 05:52:17 2003 for Modern Warfare by doxygen1.3-rc2