![]() |
Peoplemon
0.1.0
Peoplemon 3 game source documentation
|
The player menu for battles. More...
#include <PlayerMenu.hpp>
Public Member Functions | |
PlayerMenu (bl::engine::Engine &engine, bool canRun) | |
Construct a new Player Menu. More... | |
void | init (bl::rc::scene::CodeScene *scene) |
Creates UI elements and adds them to the scene. More... | |
void | refresh () |
Polls state from opened peoplemon or bag menu. More... | |
void | setPeoplemon (int i, const pplmn::BattlePeoplemon &ppl) |
Updates the menu for the given peoplemon. More... | |
void | beginTurn () |
Resets the menu to the turn start state. More... | |
void | choosePeoplemonMidTurn (bool fromFaint, bool fromRevive) |
Opens the menu to select a peoplemon to send out. More... | |
void | chooseMoveToForget () |
Initiates the process of choosing the move to forget. More... | |
bool | ready () const |
Returns true when the player's choice has been made. More... | |
TurnAction | selectedAction () const |
The selected turn action. More... | |
int | selectedMove () const |
Returns the selected move index. More... | |
item::Id | selectedItem () const |
Returns the selected item. More... | |
int | selectedPeoplemon () const |
Returns the selected peoplemon index. More... | |
void | handleInput (input::EntityControl input, bool ignoreDebounce) |
Processes player input to update the menu state. More... | |
void | render (bl::rc::scene::CodeScene::RenderContext &ctx) |
Renders the menu. More... | |
The player menu for battles.
Definition at line 29 of file PlayerMenu.hpp.
core::battle::view::PlayerMenu::PlayerMenu | ( | bl::engine::Engine & | engine, |
bool | canRun | ||
) |
Construct a new Player Menu.
engine | The game engine instance |
canRun | Whether or not to allow running |
Definition at line 21 of file PlayerMenu.cpp.
void core::battle::view::PlayerMenu::beginTurn | ( | ) |
Resets the menu to the turn start state.
Definition at line 154 of file PlayerMenu.cpp.
void core::battle::view::PlayerMenu::chooseMoveToForget | ( | ) |
Initiates the process of choosing the move to forget.
Definition at line 183 of file PlayerMenu.cpp.
void core::battle::view::PlayerMenu::choosePeoplemonMidTurn | ( | bool | fromFaint, |
bool | fromRevive | ||
) |
Opens the menu to select a peoplemon to send out.
fromFaint | True if the current peoplemon has fainted |
fromRevive | True if the eligible peoplemon must be fainted |
Definition at line 159 of file PlayerMenu.cpp.
void core::battle::view::PlayerMenu::handleInput | ( | input::EntityControl | input, |
bool | ignoreDebounce | ||
) |
Processes player input to update the menu state.
input | The control to handle |
ignoreDebounce | True to process always, false to rate limit |
Definition at line 198 of file PlayerMenu.cpp.
void core::battle::view::PlayerMenu::init | ( | bl::rc::scene::CodeScene * | scene | ) |
Creates UI elements and adds them to the scene.
scene | The scene to use |
Definition at line 31 of file PlayerMenu.cpp.
bool core::battle::view::PlayerMenu::ready | ( | ) | const |
Returns true when the player's choice has been made.
Definition at line 188 of file PlayerMenu.cpp.
void core::battle::view::PlayerMenu::refresh | ( | ) |
Polls state from opened peoplemon or bag menu.
Definition at line 132 of file PlayerMenu.cpp.
void core::battle::view::PlayerMenu::render | ( | bl::rc::scene::CodeScene::RenderContext & | ctx | ) |
TurnAction core::battle::view::PlayerMenu::selectedAction | ( | ) | const |
The selected turn action.
Definition at line 190 of file PlayerMenu.cpp.
item::Id core::battle::view::PlayerMenu::selectedItem | ( | ) | const |
Returns the selected item.
Definition at line 194 of file PlayerMenu.cpp.
int core::battle::view::PlayerMenu::selectedMove | ( | ) | const |
Returns the selected move index.
Definition at line 192 of file PlayerMenu.cpp.
int core::battle::view::PlayerMenu::selectedPeoplemon | ( | ) | const |
Returns the selected peoplemon index.
Definition at line 196 of file PlayerMenu.cpp.
void core::battle::view::PlayerMenu::setPeoplemon | ( | int | i, |
const pplmn::BattlePeoplemon & | ppl | ||
) |
Updates the menu for the given peoplemon.
i | The index of the peoplemon in the team |
ppl | The peoplemon itself |
Definition at line 93 of file PlayerMenu.cpp.