Peoplemon  0.1.0
Peoplemon 3 game source documentation
Public Types | Public Member Functions | Static Public Member Functions | List of all members
editor::component::MoveSelector Class Reference

Combobox for selecting moves. More...

#include <MoveSelector.hpp>

+ Inheritance diagram for editor::component::MoveSelector:

Public Types

using Ptr = std::shared_ptr< MoveSelector >
 Pointer to this component. More...
 
using ChangeCb = std::function< void(core::pplmn::MoveId)>
 Called when a move is selected. More...
 

Public Member Functions

core::pplmn::MoveId currentMove () const
 Returns the currently selected move. More...
 
void setCurrentMove (core::pplmn::MoveId move)
 Set the currently selected move. More...
 
void notifyPeoplemon (core::pplmn::Id ppl, unsigned int level)
 Notifies the selector of the peoplemon being selected for. More...
 
void selectRandom ()
 Selects a random move. More...
 
void refresh ()
 Refreshes the list of moves. More...
 

Static Public Member Functions

static Ptr create (bool enableFilter, const ChangeCb &changeCb={})
 Create a new MoveSelector. More...
 

Detailed Description

Combobox for selecting moves.

Definition at line 18 of file MoveSelector.hpp.

Member Typedef Documentation

◆ ChangeCb

Called when a move is selected.

Definition at line 24 of file MoveSelector.hpp.

◆ Ptr

Pointer to this component.

Definition at line 21 of file MoveSelector.hpp.

Member Function Documentation

◆ create()

MoveSelector::Ptr editor::component::MoveSelector::create ( bool  enableFilter,
const ChangeCb changeCb = {} 
)
static

Create a new MoveSelector.

Parameters
enableFilterTrue to add radio buttons to filter on peoplemon, false to show all
changeCbCalled when a move is selected
Returns
Ptr The new MoveSelector

Definition at line 12 of file MoveSelector.cpp.

◆ currentMove()

core::pplmn::MoveId editor::component::MoveSelector::currentMove ( ) const

Returns the currently selected move.

Returns
core::pplmn::MoveId The currently selected move

Definition at line 46 of file MoveSelector.cpp.

◆ notifyPeoplemon()

void editor::component::MoveSelector::notifyPeoplemon ( core::pplmn::Id  ppl,
unsigned int  level 
)

Notifies the selector of the peoplemon being selected for.

Parameters
pplThe peoplemon to select for
levelThe level of the peoplemon

Definition at line 55 of file MoveSelector.cpp.

◆ refresh()

void editor::component::MoveSelector::refresh ( )

Refreshes the list of moves.

Definition at line 61 of file MoveSelector.cpp.

◆ selectRandom()

void editor::component::MoveSelector::selectRandom ( )

Selects a random move.

Definition at line 105 of file MoveSelector.cpp.

◆ setCurrentMove()

void editor::component::MoveSelector::setCurrentMove ( core::pplmn::MoveId  move)

Set the currently selected move.

Parameters
moveThe move to select

Definition at line 51 of file MoveSelector.cpp.


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