Peoplemon  0.1.0
Peoplemon 3 game source documentation
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
core::battle::LocalBattleController Class Reference

Battle controller for local battles against peoplemon or trainers. More...

#include <LocalBattleController.hpp>

+ Inheritance diagram for core::battle::LocalBattleController:

Public Member Functions

 LocalBattleController ()
 Construct a new Local Battle Controller. More...
 
virtual ~LocalBattleController ()=default
 Destroy the Local Battle Controller. More...
 
void init (Battle &battle, BattleView &view, BattleState &state)
 Sets internal references to the view and state of the battle. More...
 
void update ()
 Updates the processing of the command queue. More...
 
void queueCommand (Command &&command, bool addWait=false)
 Enqueues a command to manipulate battle state or the view. More...
 

Protected Member Functions

void updateBattleState (bool viewSynced, bool queueEmpty)
 Updates the battle state based on the previous state, view state, and queue state. More...
 

Protected Attributes

Battlebattle
 
BattleViewview
 
BattleStatestate
 

Detailed Description

Battle controller for local battles against peoplemon or trainers.

Definition at line 18 of file LocalBattleController.hpp.

Constructor & Destructor Documentation

◆ LocalBattleController()

core::battle::LocalBattleController::LocalBattleController ( )

Construct a new Local Battle Controller.

Definition at line 106 of file LocalBattleController.cpp.

◆ ~LocalBattleController()

virtual core::battle::LocalBattleController::~LocalBattleController ( )
virtualdefault

Destroy the Local Battle Controller.

Member Function Documentation

◆ init()

void core::battle::BattleController::init ( Battle battle,
BattleView view,
BattleState state 
)
inherited

Sets internal references to the view and state of the battle.

Parameters
battleThe battle itself
viewThe view of the battle
stateThe state of the battle

Definition at line 16 of file BattleController.cpp.

◆ queueCommand()

void core::battle::BattleController::queueCommand ( Command &&  command,
bool  addWait = false 
)
inherited

Enqueues a command to manipulate battle state or the view.

Parameters
commandThe command to enqueue
addWaitTrue to add a waitView command after the given command

Definition at line 49 of file BattleController.cpp.

◆ update()

void core::battle::BattleController::update ( )
inherited

Updates the processing of the command queue.

Definition at line 22 of file BattleController.cpp.

◆ updateBattleState()

void core::battle::LocalBattleController::updateBattleState ( bool  viewSynced,
bool  queueEmpty 
)
protected

Updates the battle state based on the previous state, view state, and queue state.

Parameters
viewSyncedWhether or not the view is up-to-date and static
queueEmptyWhether or not the command queue has been emptied fully

Definition at line 121 of file LocalBattleController.cpp.

Member Data Documentation

◆ battle

Battle* core::battle::BattleController::battle
protectedinherited

Definition at line 61 of file BattleController.hpp.

◆ state

BattleState* core::battle::BattleController::state
protectedinherited

Definition at line 63 of file BattleController.hpp.

◆ view

BattleView* core::battle::BattleController::view
protectedinherited

Definition at line 62 of file BattleController.hpp.


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