|
|
This class represents a computer player. It holds all strategic routines
~AIPlayer ()
| ~AIPlayer |
AIPlayer (QString & nomPlayer, int nbArmies,
Nationality * myNation,PlayersArray* players, ONU* world,
KGameWindow* game )
| AIPlayer |
Constructor with simple initializations
int operator == (AIPlayer Arg1)
| operator == |
[virtual]
bit to bit comparison
Reimplemented from Player.
void actionChoice (GameState state)
| actionChoice |
[virtual]
This function is called whenever the player should choose an action ( attack, defence, etc.). It has the responsability to choose the correct action depending on the state of the game.
Reimplemented from Player.
QPtrList<Country> countries (void)
| countries |
[const]
Returns the list of the countries owned by this player
bool isAI ()
| isAI |
[const virtual]
Returns true (an AIPlayer is an AI)
Reimplemented from Player.
void run (void)
| run |
[virtual]
QPtrQueue | getClickedPoints |
[virtual]
Read property of QPtrQueue
Reimplemented from Player.
QPtrQueue | getActionsQueue |
[virtual]
Read property of QPtrQueue
Reimplemented from Player.
void chooseAttackMoveArmiesOrNextPlayer (void)
| chooseAttackMoveArmiesOrNextPlayer |
Chooses the next action. In the current basic setting, chooses at random between the three possibilities. For each, chooses randomly the parameters.If the randomly choosen parameters end by an impossible action, continue with next player.
void stop (void)
| stop |
PlayersArray* allPlayers | allPlayers |
[private]
ONU* theWorld | theWorld |
[private]
KGameWindow* theGame | theGame |
[private]
QPtrQueue | clickedPoints |
[private]
QPtrQueue | actionsQueue |
[private]
bool stopMe | stopMe |
[private]
Country* chooseReceivingCountry (void)
| chooseReceivingCountry |
[private]
Chooses a country to receive a new army in dotation
std::pair< const Country*, const Country* > chooseBelligerant (void)
| chooseBelligerant |
[private const]
void actionAtPoint (const QPoint &p)
| actionAtPoint |
[signal]