Terminus
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
terminus::AIPlayer Class Reference

The AIPlayer class implements a simple artificial intelligence enemy player. More...

#include <aiplayer.h>

Inheritance diagram for terminus::AIPlayer:
terminus::AbstractPlayer

Public Member Functions

 AIPlayer (World &world, Train *train, Train *enemyTrain)
 
virtual void update () override
 Contains the AI logic and determines what to do in this frame. More...
 
- Public Member Functions inherited from terminus::AbstractPlayer
 AbstractPlayer (World &world, Train *train)
 
Cameracamera ()
 
Traintrain ()
 
bool hasWon ()
 
bool hasLost ()
 
void toggleCameraLock ()
 
unsigned int selectedWagonIndex () const
 
void switchToNextWagon ()
 
void switchToPreviousWagon ()
 
void switchToWagon (unsigned int wagonIndex)
 
virtual void primaryAction ()
 Triggers the primary action of the currently selected wagon. More...
 
virtual void primaryActionDebug ()
 Triggers the primary debug action of the currently selected wagon (typically the primary action without cooldown limitations etc.) More...
 
virtual void animateHit ()
 

Protected Member Functions

void switchWagon ()
 Switches randomly to next or previous wagon. More...
 
void fire ()
 Finds a target wagon and fires a projectile from the currently focusedWagon in that direction. More...
 
- Protected Member Functions inherited from terminus::AbstractPlayer
AbstractWagonselectedWagon ()
 

Protected Attributes

Trainm_enemyTrain
 
AbstractWagonm_targetEnemyWagon
 
- Protected Attributes inherited from terminus::AbstractPlayer
Worldm_world
 
Camera m_camera
 
Trainm_train
 
bool m_animationInProgress
 
Timer::TimerID m_animationTimer
 
unsigned int m_selectedWagonIndex
 

Detailed Description

The AIPlayer class implements a simple artificial intelligence enemy player.

Constructor & Destructor Documentation

terminus::AIPlayer::AIPlayer ( World world,
Train train,
Train enemyTrain 
)

Member Function Documentation

void terminus::AIPlayer::fire ( )
protected

Finds a target wagon and fires a projectile from the currently focusedWagon in that direction.

void terminus::AIPlayer::switchWagon ( )
protected

Switches randomly to next or previous wagon.

void terminus::AIPlayer::update ( )
overridevirtual

Contains the AI logic and determines what to do in this frame.

The AI player switches wagons when they are not usable (disabled or on cooldown), uses RepairWagons and uses WeaponWagons by firing Projectiles at randomly selected wagons of the enemy player.

Reimplemented from terminus::AbstractPlayer.

Member Data Documentation

Train* terminus::AIPlayer::m_enemyTrain
protected
AbstractWagon* terminus::AIPlayer::m_targetEnemyWagon
protected

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