Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

AI Class Reference

#include <ai.h>

Inheritance diagram for AI:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 AI (GameMap *_map, int _player)
void run ()
void run (bool benchmark)
 starts the Ai. If benchmark is true, the AI might take longer since it is not time limited, it won't display any graphics and will output the time it needed to run completely
GameMapgetMap (void)
 returns the map this AI runson
int getPlayerNum (void)
 returns the number of the player which is controlled by this ai
PlayergetPlayer (void)
PlayergetPlayer (int player)
PlayergetPlayer (PlayerID id)
void showFieldInformation (int x, int y)
bool isRunning (void)
VisibilityStates getVision (void)
 the AI uses a different vision than human player, to counter the fact that a human player can "know" a map and take a look before starting to play.
void read (tnstream &stream)
void write (tnstream &stream) const
 ~AI ()

Static Public Member Functions

static bool moveVariantComp (const AI::MoveVariant *mv1, const AI::MoveVariant *mv2)

Friends

class ServiceOrder
class RefuelConstraint
class CheckFieldRecon
class BuildingValueComp
class CalculateThreat_Vehicle
class VehicleTypeEfficiencyCalculator
class Section
class Sections

Classes

class  AiResult
class  BuildingCapture
class  BuildingValueComp
class  CheckFieldRecon
struct  Config
class  FieldInformation
class  MoveVariant
struct  ProductionRating
class  RefuelConstraint
class  Section
class  Sections
class  ServiceOrder
class  ServiceTargetEquals
class  TargetVector
class  UnitDistribution
class  VehicleTypeEfficiencyCalculator
class  WeaponThreatRange

Constructor & Destructor Documentation

AI::AI GameMap _map,
int  _player
 

Definition at line 27 of file base.cpp.

References getDefaultMapDisplay(), CGameOptions::Instance(), and ReplayMapDisplay::setCursorDelay().

AI::~AI  ) 
 

Definition at line 564 of file base.cpp.


Member Function Documentation

GameMap* AI::getMap void   )  [inline]
 

returns the map this AI runson

Definition at line 481 of file ai.h.

Referenced by HiddenAStar3D::getMoveCost(), StratAStar3D::getMoveCost(), getPlayer(), run(), showFieldInformation(), and UnitAttacksUnit_FakeHemming::UnitAttacksUnit_FakeHemming().

Player& AI::getPlayer PlayerID  id  )  [inline]
 

Definition at line 488 of file ai.h.

References getMap().

Player& AI::getPlayer int  player  )  [inline]
 

Definition at line 487 of file ai.h.

References getMap().

Player& AI::getPlayer void   )  [inline]
 

Definition at line 486 of file ai.h.

References getMap().

Referenced by SearchReconquerBuilding::testfield().

int AI::getPlayerNum void   )  [inline]
 

returns the number of the player which is controlled by this ai

Definition at line 484 of file ai.h.

Referenced by CalculateThreat_Vehicle::calc_threat_vehicle(), CalculateThreat_VehicleType::calc_threat_vehicletype(), HiddenAStar3D::getMoveCost(), HiddenAStar::getMoveCost(), showFieldInformation(), and SearchReconquerBuilding::unitfound().

VisibilityStates AI::getVision void   )  [virtual]
 

the AI uses a different vision than human player, to counter the fact that a human player can "know" a map and take a look before starting to play.

This function returns the minimum visibility state of a field.

See also:
tfield::visible , VisibilityStates

Implements BaseAI.

Definition at line 339 of file base.cpp.

bool AI::isRunning void   )  [virtual]
 

Implements BaseAI.

Definition at line 333 of file base.cpp.

bool AI::moveVariantComp const AI::MoveVariant mv1,
const AI::MoveVariant mv2
[static]
 

Definition at line 162 of file tactics.cpp.

void AI::read tnstream stream  )  [virtual]
 

Implements BaseAI.

Definition at line 443 of file base.cpp.

References currentServiceOrderVersion, MapCoordinate::read(), tnstream::readInt(), and ServiceOrder.

Referenced by tgameloaders::readAI().

void AI::run bool  benchmark  ) 
 

starts the Ai. If benchmark is true, the AI might take longer since it is not time limited, it won't display any graphics and will output the time it needed to run completely

Definition at line 205 of file base.cpp.

References checkforvictory(), displaymessage(), displaymessage2(), getMap(), repaintMap, ticker, and visible_ago.

void AI::run void   )  [inline, virtual]
 

Implements BaseAI.

Definition at line 476 of file ai.h.

void AI::showFieldInformation int  x,
int  y
 

Definition at line 344 of file base.cpp.

References AIjobs, Vehicle::aiparam, AItasks, aiValueTypeNum, choehenstufen, AiParameter::dest, fieldvisiblenow(), MapCoordinate3D::getBitmappedHeight(), getfield(), AiParameter::getJob(), getMap(), getPlayerNum(), AiParameter::getTask(), AiValue::getValue(), ContainerBaseType::id, Vehicle::networkid, repaintMap, ASC_PG_Dialog::RunModal(), Section, PG_Widget::Show(), strrr(), AiThreat::threat, Vehicle::typ, tfield::vehicle, MapCoordinate::x, and MapCoordinate::y.

Referenced by ASC_MainScreenWidget::eventKeyDown().

void AI::write tnstream stream  )  const [virtual]
 

Implements BaseAI.

Definition at line 517 of file base.cpp.

References tnstream::writeInt().


Friends And Related Function Documentation

friend class BuildingValueComp [friend]
 

Definition at line 232 of file ai.h.

friend class CalculateThreat_Vehicle [friend]
 

Definition at line 350 of file ai.h.

friend class CheckFieldRecon [friend]
 

Definition at line 188 of file ai.h.

friend class RefuelConstraint [friend]
 

Definition at line 158 of file ai.h.

friend class Section [friend]
 

Definition at line 445 of file ai.h.

Referenced by showFieldInformation().

friend class Sections [friend]
 

Definition at line 464 of file ai.h.

friend class ServiceOrder [friend]
 

Definition at line 111 of file ai.h.

Referenced by read().

friend class VehicleTypeEfficiencyCalculator [friend]
 

Definition at line 407 of file ai.h.


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:15:59 2008 for Advanced Strategic Command by  doxygen 1.4.2