Interface for battle controllers. Battle controllers manage the flow of state and interaction for battles.
More...
#include <BattleController.hpp>
|
virtual void | onCommandQueued (const Command &cmd)=0 |
| Called when a command is first enqueued but not processed. May be used to send commands over the network, for example. More...
|
|
virtual void | onCommandProcessed (const Command &cmd)=0 |
| This is called after a command is processed. Derived classes may perform specific actions for commands in this method, such as sending state across the network. More...
|
|
virtual void | onUpdate (bool viewSynced, bool queueEmpty)=0 |
| Derived controllers may use this method for update logic every frame. More...
|
|
Interface for battle controllers. Battle controllers manage the flow of state and interaction for battles.
Definition at line 23 of file BattleController.hpp.
◆ BattleController()
core::battle::BattleController::BattleController |
( |
| ) |
|
◆ ~BattleController()
virtual core::battle::BattleController::~BattleController |
( |
| ) |
|
|
virtualdefault |
Destroy the Battle Controller object.
◆ init()
Sets internal references to the view and state of the battle.
- Parameters
-
battle | The battle itself |
view | The view of the battle |
state | The state of the battle |
Definition at line 16 of file BattleController.cpp.
◆ onCommandProcessed()
virtual void core::battle::BattleController::onCommandProcessed |
( |
const Command & |
cmd | ) |
|
|
protectedpure virtual |
This is called after a command is processed. Derived classes may perform specific actions for commands in this method, such as sending state across the network.
- Parameters
-
cmd | The command that was just processed |
◆ onCommandQueued()
virtual void core::battle::BattleController::onCommandQueued |
( |
const Command & |
cmd | ) |
|
|
protectedpure virtual |
Called when a command is first enqueued but not processed. May be used to send commands over the network, for example.
- Parameters
-
cmd | The command that was just enqueued |
◆ onUpdate()
virtual void core::battle::BattleController::onUpdate |
( |
bool |
viewSynced, |
|
|
bool |
queueEmpty |
|
) |
| |
|
protectedpure virtual |
Derived controllers may use this method for update logic every frame.
- Parameters
-
viewSynced | Whether or not the view is fully up to date and static |
queueEmpty | Whether or not the command queue has been fully drained |
◆ queueCommand()
void core::battle::BattleController::queueCommand |
( |
Command && |
command, |
|
|
bool |
addWait = false |
|
) |
| |
Enqueues a command to manipulate battle state or the view.
- Parameters
-
command | The command to enqueue |
addWait | True to add a waitView command after the given command |
Definition at line 49 of file BattleController.cpp.
◆ update()
void core::battle::BattleController::update |
( |
| ) |
|
◆ battle
Battle* core::battle::BattleController::battle |
|
protected |
◆ state
◆ view
The documentation for this class was generated from the following files: