![]() |
Peoplemon
0.1.0
Peoplemon 3 game source documentation
|
This is the top level class for rendering battles. It takes commands and state from a BattleController and updates itself independently of battle logic. More...
#include <BattleView.hpp>
Public Member Functions | |
BattleView (bl::engine::Engine &engine, BattleState &state, bool canRun) | |
Construct a new Battle View. More... | |
void | init (bl::rc::scene::CodeScene *scene) |
Initializes renderer data, loads resources, and adds entities to the scene. More... | |
view::PlayerMenu & | menu () |
Access the player's menu. More... | |
bool | playerChoseForgetMove () const |
Returns whether or not the player chose to forget a move when prompted. More... | |
bool | playerChoseToSetName () const |
Returns whether or not the player chose to set a nickname on a new Peoplemon. More... | |
const std::string & | chosenNickname () const |
Returns the nickname the player entered. More... | |
bool | actionsCompleted () const |
Returns true if the view is done going through the queued commands and all components are synchronized with the desired state. Returns false if the view is still changing, playing animations, or printing messages. More... | |
void | hideText () |
Hides the battle text when the view is synced. More... | |
void | processCommand (const Command &command) |
Processes a command and updates the view. More... | |
void | update (float dt) |
Updates the view, including contained animations and printing text. More... | |
void | render (bl::rc::scene::CodeScene::RenderContext &ctx) |
Renders the battle view. More... | |
This is the top level class for rendering battles. It takes commands and state from a BattleController and updates itself independently of battle logic.
Definition at line 29 of file BattleView.hpp.
core::battle::BattleView::BattleView | ( | bl::engine::Engine & | engine, |
BattleState & | state, | ||
bool | canRun | ||
) |
Construct a new Battle View.
engine | The game engine instance |
state | The current state of the battle |
canRun | Whether or not the player menu should allow running |
Definition at line 11 of file BattleView.cpp.
bool core::battle::BattleView::actionsCompleted | ( | ) | const |
Returns true if the view is done going through the queued commands and all components are synchronized with the desired state. Returns false if the view is still changing, playing animations, or printing messages.
Definition at line 42 of file BattleView.cpp.
const std::string & core::battle::BattleView::chosenNickname | ( | ) | const |
Returns the nickname the player entered.
Definition at line 116 of file BattleView.cpp.
void core::battle::BattleView::hideText | ( | ) |
Hides the battle text when the view is synced.
Definition at line 47 of file BattleView.cpp.
void core::battle::BattleView::init | ( | bl::rc::scene::CodeScene * | scene | ) |
Initializes renderer data, loads resources, and adds entities to the scene.
scene | The scene to add entities to |
Definition at line 21 of file BattleView.cpp.
view::PlayerMenu & core::battle::BattleView::menu | ( | ) |
Access the player's menu.
Definition at line 110 of file BattleView.cpp.
bool core::battle::BattleView::playerChoseForgetMove | ( | ) | const |
Returns whether or not the player chose to forget a move when prompted.
Definition at line 112 of file BattleView.cpp.
bool core::battle::BattleView::playerChoseToSetName | ( | ) | const |
Returns whether or not the player chose to set a nickname on a new Peoplemon.
Definition at line 114 of file BattleView.cpp.
void core::battle::BattleView::processCommand | ( | const Command & | command | ) |
Processes a command and updates the view.
command | The command to process |
Definition at line 49 of file BattleView.cpp.
void core::battle::BattleView::render | ( | bl::rc::scene::CodeScene::RenderContext & | ctx | ) |
Renders the battle view.
ctx | The render context |
Definition at line 126 of file BattleView.cpp.
void core::battle::BattleView::update | ( | float | dt | ) |
Updates the view, including contained animations and printing text.
dt | Time elapsed in seconds |
Definition at line 118 of file BattleView.cpp.