Peoplemon  0.1.0
Peoplemon 3 game source documentation
MoveSelector.hpp
Go to the documentation of this file.
1 #ifndef EDITOR_COMPONENTS_MOVESELECTOR_HPP
2 #define EDITOR_COMPONENTS_MOVESELECTOR_HPP
3 
4 #include <BLIB/Interfaces/GUI.hpp>
7 
8 namespace editor
9 {
10 namespace component
11 {
18 class MoveSelector : public bl::gui::Box {
19 public:
21  using Ptr = std::shared_ptr<MoveSelector>;
22 
24  using ChangeCb = std::function<void(core::pplmn::MoveId)>;
25 
33  static Ptr create(bool enableFilter, const ChangeCb& changeCb = {});
34 
41 
48 
55  void notifyPeoplemon(core::pplmn::Id ppl, unsigned int level);
56 
61  void selectRandom();
62 
67  void refresh();
68 
69 private:
70  core::pplmn::Id peoplemon;
71  unsigned int level;
72  std::vector<core::pplmn::MoveId> validMoves;
73  bl::gui::ComboBox::Ptr selector;
74  bl::gui::RadioButton::Ptr noMoveFilter;
75  bl::gui::RadioButton::Ptr levelMoveFilter;
76  bl::gui::RadioButton::Ptr poolMoveFilter;
77 
78  MoveSelector(bool enableFilter, const ChangeCb& ccb);
79 };
80 
81 } // namespace component
82 } // namespace editor
83 
84 #endif
MoveId
The id of a move.
Definition: MoveId.hpp:16
Id
The id of a peoplemon.
Definition: Id.hpp:16
All classes and functionality used for implementing the game editor.
Definition: Tile.hpp:11
Combobox for selecting moves.
void setCurrentMove(core::pplmn::MoveId move)
Set the currently selected move.
void selectRandom()
Selects a random move.
void notifyPeoplemon(core::pplmn::Id ppl, unsigned int level)
Notifies the selector of the peoplemon being selected for.
std::function< void(core::pplmn::MoveId)> ChangeCb
Called when a move is selected.
static Ptr create(bool enableFilter, const ChangeCb &changeCb={})
Create a new MoveSelector.
std::shared_ptr< MoveSelector > Ptr
Pointer to this component.
core::pplmn::MoveId currentMove() const
Returns the currently selected move.
void refresh()
Refreshes the list of moves.