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

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>

+ Inheritance diagram for core::battle::BattleView:

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::PlayerMenumenu ()
 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ BattleView()

core::battle::BattleView::BattleView ( bl::engine::Engine &  engine,
BattleState state,
bool  canRun 
)

Construct a new Battle View.

Parameters
engineThe game engine instance
stateThe current state of the battle
canRunWhether or not the player menu should allow running

Definition at line 11 of file BattleView.cpp.

Member Function Documentation

◆ actionsCompleted()

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.

◆ chosenNickname()

const std::string & core::battle::BattleView::chosenNickname ( ) const

Returns the nickname the player entered.

Definition at line 116 of file BattleView.cpp.

◆ hideText()

void core::battle::BattleView::hideText ( )

Hides the battle text when the view is synced.

Definition at line 47 of file BattleView.cpp.

◆ init()

void core::battle::BattleView::init ( bl::rc::scene::CodeScene *  scene)

Initializes renderer data, loads resources, and adds entities to the scene.

Parameters
sceneThe scene to add entities to

Definition at line 21 of file BattleView.cpp.

◆ menu()

view::PlayerMenu & core::battle::BattleView::menu ( )

Access the player's menu.

Definition at line 110 of file BattleView.cpp.

◆ playerChoseForgetMove()

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.

◆ playerChoseToSetName()

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.

◆ processCommand()

void core::battle::BattleView::processCommand ( const Command command)

Processes a command and updates the view.

Parameters
commandThe command to process

Definition at line 49 of file BattleView.cpp.

◆ render()

void core::battle::BattleView::render ( bl::rc::scene::CodeScene::RenderContext &  ctx)

Renders the battle view.

Parameters
ctxThe render context

Definition at line 126 of file BattleView.cpp.

◆ update()

void core::battle::BattleView::update ( float  dt)

Updates the view, including contained animations and printing text.

Parameters
dtTime elapsed in seconds

Definition at line 118 of file BattleView.cpp.


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