Advanced Strategic Command
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
AI Class Reference

#include <ai.h>

Inheritance diagram for AI:
Inheritance graph
[legend]

Classes

class  MoveVariant
 

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 More...
 
GameMapgetMap (void)
 returns the map this AI runson More...
 
const GameMapgetMap (void) const
 
int getPlayerNum (void)
 returns the number of the player which is controlled by this ai More...
 
PlayergetPlayer (void)
 
PlayergetPlayer (int player)
 
PlayergetPlayer (PlayerID id)
 
void showFieldInformation (int x, int y)
 
bool isRunning (void)
 
bool isRunning (void) const
 
void isRunning (bool b)
 
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. More...
 
VisibilityStates getVision (void) const
 
void setVision (VisibilityStates v)
 
void read (tnstream &stream)
 
void write (tnstream &stream) const
 
Context getContext ()
 
 ~AI ()
 
- Public Member Functions inherited from BaseAI
virtual ~BaseAI ()
 

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
 

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.

References isRunning().

AI::~AI ( )

Definition at line 610 of file base.cpp.

Member Function Documentation

Context AI::getContext ( )
GameMap* AI::getMap ( void  )
inline
const GameMap* AI::getMap ( void  ) const
inline

Definition at line 487 of file ai.h.

Player& AI::getPlayer ( void  )
inline

Definition at line 492 of file ai.h.

References getMap(), and GameMap::player.

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

Player& AI::getPlayer ( int  player)
inline

Definition at line 493 of file ai.h.

References getMap(), and GameMap::player.

Player& AI::getPlayer ( PlayerID  id)
inline

Definition at line 494 of file ai.h.

References getMap(), and GameMap::player.

int AI::getPlayerNum ( void  )
inline
VisibilityStates AI::getVision ( void  )
inlinevirtual

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 506 of file ai.h.

References getMap(), and GameMap::playerAiVision.

Referenced by write().

VisibilityStates AI::getVision ( void  ) const
inline

Definition at line 507 of file ai.h.

References getMap(), and GameMap::playerAiVision.

bool AI::isRunning ( void  )
inlinevirtual

Implements BaseAI.

Definition at line 497 of file ai.h.

References getMap(), and GameMap::playerAiRunning.

Referenced by AI(), read(), run(), and write().

bool AI::isRunning ( void  ) const
inline

Definition at line 498 of file ai.h.

References getMap(), and GameMap::playerAiRunning.

void AI::isRunning ( bool  b)
inline

Definition at line 499 of file ai.h.

References getMap(), and GameMap::playerAiRunning.

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

Definition at line 178 of file tactics.cpp.

void AI::read ( tnstream stream)
virtual
void AI::run ( MapDisplayInterface mapDisplay)
inlinevirtual

Implements BaseAI.

Definition at line 481 of file ai.h.

References run().

Referenced by run().

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

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

void AI::setVision ( VisibilityStates  v)
inline

Definition at line 508 of file ai.h.

References getMap(), and GameMap::playerAiVision.

Referenced by read(), and run().

void AI::showFieldInformation ( int  x,
int  y 
)
void AI::write ( tnstream stream) const
virtual

Implements BaseAI.

Definition at line 551 of file base.cpp.

References currentAiStreamVersion, getVision(), isRunning(), tnstream::writeFloat(), and tnstream::writeInt().

Friends And Related Function Documentation

friend class BuildingValueComp
friend

Definition at line 242 of file ai.h.

friend class CalculateThreat_Vehicle
friend

Definition at line 358 of file ai.h.

friend class CheckFieldRecon
friend

Definition at line 198 of file ai.h.

friend class RefuelConstraint
friend

Definition at line 168 of file ai.h.

friend class Section
friend

Definition at line 448 of file ai.h.

Referenced by showFieldInformation().

friend class Sections
friend

Definition at line 469 of file ai.h.

friend class ServiceOrder
friend

Definition at line 118 of file ai.h.

Referenced by read().

friend class VehicleTypeEfficiencyCalculator
friend

Definition at line 410 of file ai.h.


The documentation for this class was generated from the following files: