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 (MapDisplayInterface *mapDisplay)
void run (bool benchmark, MapDisplayInterface *mapDisplay)
 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
Context getContext ()
 ~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

Detailed Description

Definition at line 44 of file ai.h.


Constructor & Destructor Documentation

AI::AI ( GameMap _map,
int  _player 
)

Definition at line 28 of file base.cpp.

AI::~AI (  ) 

Definition at line 614 of file base.cpp.


Member Function Documentation

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

Definition at line 178 of file tactics.cpp.

void AI::run ( MapDisplayInterface mapDisplay  )  [inline, virtual]

Implements BaseAI.

Definition at line 491 of file ai.h.

void AI::run ( bool  benchmark,
MapDisplayInterface mapDisplay 
)

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 232 of file base.cpp.

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

GameMap* AI::getMap ( void   )  [inline]

returns the map this AI runson

Definition at line 496 of file ai.h.

Referenced by CalculateThreat_VehicleType::calc_threat_vehicletype(), getContext(), HiddenAStar3D::getMoveCost(), HiddenAStar::getMoveCost(), AntiMineAStar3D::getMoveCost(), StratAStar3D::getMoveCost(), StratAStar::getMoveCost(), getPlayer(), run(), showFieldInformation(), and UnitAttacksUnit_FakeHemming::UnitAttacksUnit_FakeHemming().

int AI::getPlayerNum ( void   )  [inline]

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

Definition at line 499 of file ai.h.

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

Player& AI::getPlayer ( void   )  [inline]

Definition at line 501 of file ai.h.

References getMap(), and GameMap::player.

Referenced by getContext(), and SearchReconquerBuilding::testfield().

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

Definition at line 502 of file ai.h.

References getMap(), and GameMap::player.

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

Definition at line 503 of file ai.h.

References getMap(), and GameMap::player.

void AI::showFieldInformation ( int  x,
int  y 
)

Definition at line 382 of file base.cpp.

References MapField::a, AIjobs, Vehicle::aiparam, AItasks, aiValueTypeNum, choehenstufen, GameMap::cleartemps(), AiParameter::dest, fieldvisiblenow(), MapCoordinate3D::getBitmappedHeight(), GameMap::getField(), AiParameter::getJob(), getMap(), getPlayerNum(), AiParameter::getTask(), AiValue::getValue(), ContainerBaseType::id, Vehicle::networkid, repaintMap, Section, strrr(), AiThreat::threat, Vehicle::typ, MapField::vehicle, MapCoordinate::x, and MapCoordinate::y.

Referenced by ASC_MainScreenWidget::eventKeyDown().

bool AI::isRunning ( void   )  [virtual]

Implements BaseAI.

Definition at line 371 of file base.cpp.

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 377 of file base.cpp.

void AI::read ( tnstream stream  )  [virtual]

Implements BaseAI.

Definition at line 481 of file base.cpp.

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

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

Implements BaseAI.

Definition at line 555 of file base.cpp.

References tnstream::writeFloat(), and tnstream::writeInt().

Context AI::getContext (  ) 

Definition at line 601 of file base.cpp.

References Context::actingPlayer, Context::actionContainer, GameMap::actions, Context::display, Context::gamemap, getMap(), getPlayer(), GameMap::getPlayerView(), Context::parentAction, and Context::viewingPlayer.


Friends And Related Function Documentation

friend class ServiceOrder [friend]

Definition at line 118 of file ai.h.

Referenced by read().

friend class RefuelConstraint [friend]

Definition at line 167 of file ai.h.

friend class CheckFieldRecon [friend]

Definition at line 197 of file ai.h.

friend class BuildingValueComp [friend]

Definition at line 241 of file ai.h.

friend class CalculateThreat_Vehicle [friend]

Definition at line 363 of file ai.h.

friend class VehicleTypeEfficiencyCalculator [friend]

Definition at line 420 of file ai.h.

friend class Section [friend]

Definition at line 458 of file ai.h.

Referenced by showFieldInformation().

friend class Sections [friend]

Definition at line 479 of file ai.h.


The documentation for this class was generated from the following files:
Generated on Mon May 21 01:46:15 2012 for Advanced Strategic Command by  doxygen 1.5.1