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

Helper utility for printing battle messages. More...

#include <MessagePrinter.hpp>

Public Member Functions

 MessagePrinter (bl::engine::Engine &engine)
 Construct a new Message Printer utility. More...
 
void init (bl::rc::scene::CodeScene *scene)
 Initializes the UI components and adds to scene. More...
 
void setMessage (BattleState &state, const cmd::Message &message)
 Set the message to be printed. More...
 
void process (input::EntityControl ctrl, bool ignoreDebounce)
 Displays the full message. Call when user presses the continue button. More...
 
bool messageDone () const
 Returns true when the full message is on display and finishPrint() has been called. More...
 
bool choseToForget () const
 Returns whether or not the player chose to forget a move. More...
 
bool choseToSetName () const
 Whether or not the player chose to set a nickname. More...
 
const std::string & chosenNickname () const
 Returns the nickname chosen by the player. More...
 
void hide ()
 Hides the text once the view is fully synced. More...
 
void update (float dt)
 Updates the ghost writer. More...
 
void render (bl::rc::scene::CodeScene::RenderContext &ctx)
 Renders the message. More...
 

Detailed Description

Helper utility for printing battle messages.

Definition at line 26 of file MessagePrinter.hpp.

Constructor & Destructor Documentation

◆ MessagePrinter()

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

Construct a new Message Printer utility.

Definition at line 54 of file MessagePrinter.cpp.

Member Function Documentation

◆ chosenNickname()

const std::string & core::battle::view::MessagePrinter::chosenNickname ( ) const

Returns the nickname chosen by the player.

Definition at line 1126 of file MessagePrinter.cpp.

◆ choseToForget()

bool core::battle::view::MessagePrinter::choseToForget ( ) const

Returns whether or not the player chose to forget a move.

Definition at line 1120 of file MessagePrinter.cpp.

◆ choseToSetName()

bool core::battle::view::MessagePrinter::choseToSetName ( ) const

Whether or not the player chose to set a nickname.

Definition at line 1122 of file MessagePrinter.cpp.

◆ hide()

void core::battle::view::MessagePrinter::hide ( )

Hides the text once the view is fully synced.

Definition at line 1072 of file MessagePrinter.cpp.

◆ init()

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

Initializes the UI components and adds to scene.

Parameters
sceneThe scene to add to

Definition at line 60 of file MessagePrinter.cpp.

◆ messageDone()

bool core::battle::view::MessagePrinter::messageDone ( ) const

Returns true when the full message is on display and finishPrint() has been called.

Definition at line 1074 of file MessagePrinter.cpp.

◆ process()

void core::battle::view::MessagePrinter::process ( input::EntityControl  ctrl,
bool  ignoreDebounce 
)

Displays the full message. Call when user presses the continue button.

Parameters
ctrlThe control to process
ignoreDebounceTrue to always process, false to rate limit

Definition at line 1031 of file MessagePrinter.cpp.

◆ render()

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

Renders the message.

Parameters
ctxThe render context

Definition at line 1098 of file MessagePrinter.cpp.

◆ setMessage()

void core::battle::view::MessagePrinter::setMessage ( BattleState state,
const cmd::Message message 
)

Set the message to be printed.

Parameters
stateThe current state of the battle
messageThe message to display

Definition at line 93 of file MessagePrinter.cpp.

◆ update()

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

Updates the ghost writer.

Parameters
dtTime elapsed in seconds

Definition at line 1078 of file MessagePrinter.cpp.


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