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

Renders both the player and opponent stat boxes. More...

#include <StatBoxes.hpp>

Public Member Functions

 StatBoxes (bl::engine::Engine &engine)
 Construct a new Stat Boxes component. More...
 
void init (bl::rc::scene::CodeScene *scene)
 Creates entities and adds them to the scene. More...
 
void setOpponent (pplmn::BattlePeoplemon *ppl)
 Sets the opponent's peoplemon. Syncs right away. More...
 
void setPlayer (pplmn::BattlePeoplemon *ppl)
 Sets the player's peoplemon. Syncs right away. More...
 
void sync (bool fromSwitch=false)
 Updates the UI to reflect the current peoplemon state. More...
 
void update (float dt)
 Updates bar sizes if they need to change. More...
 
bool synced () const
 Returns true if the view is in sync, false if an animation is in progress. More...
 
void render (bl::rc::scene::CodeScene::RenderContext &ctx)
 Renders the boxes. More...
 

Detailed Description

Renders both the player and opponent stat boxes.

Definition at line 21 of file StatBoxes.hpp.

Constructor & Destructor Documentation

◆ StatBoxes()

core::battle::view::StatBoxes::StatBoxes ( bl::engine::Engine &  engine)

Construct a new Stat Boxes component.

Parameters
engineThe game engine instance

Definition at line 39 of file StatBoxes.cpp.

Member Function Documentation

◆ init()

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

Creates entities and adds them to the scene.

Parameters
sceneThe scene to add to

Definition at line 49 of file StatBoxes.cpp.

◆ render()

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

Renders the boxes.

Parameters
ctxThe render context

Definition at line 246 of file StatBoxes.cpp.

◆ setOpponent()

void core::battle::view::StatBoxes::setOpponent ( pplmn::BattlePeoplemon ppl)

Sets the opponent's peoplemon. Syncs right away.

Parameters
pplThe opponent's peoplemon

Definition at line 124 of file StatBoxes.cpp.

◆ setPlayer()

void core::battle::view::StatBoxes::setPlayer ( pplmn::BattlePeoplemon ppl)

Sets the player's peoplemon. Syncs right away.

Parameters
pplThe player's peoplemon

Definition at line 131 of file StatBoxes.cpp.

◆ sync()

void core::battle::view::StatBoxes::sync ( bool  fromSwitch = false)

Updates the UI to reflect the current peoplemon state.

Parameters
fromSwitchTrue to sync from switch, false for regular sync

Definition at line 139 of file StatBoxes.cpp.

◆ synced()

bool core::battle::view::StatBoxes::synced ( ) const

Returns true if the view is in sync, false if an animation is in progress.

Definition at line 241 of file StatBoxes.cpp.

◆ update()

void core::battle::view::StatBoxes::update ( float  dt)

Updates bar sizes if they need to change.

Parameters
dtTime elapsed in seconds

Definition at line 176 of file StatBoxes.cpp.


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