Peoplemon  0.1.0
Peoplemon 3 game source documentation
StatBox.hpp
Go to the documentation of this file.
1 #ifndef EDITOR_COMPONENTS_STATBOX_HPP
2 #define EDITOR_COMPONENTS_STATBOX_HPP
3 
4 #include <BLIB/Interfaces/GUI.hpp>
6 
7 namespace editor
8 {
9 namespace component
10 {
17 class StatBox {
18 public:
20  enum Mode { EV, IV };
21 
27  StatBox(Mode mode, bool showRandomBut = true);
28 
34 
40  void update(const core::pplmn::Stats& value);
41 
48  void notifyLevel(unsigned int level);
49 
54  void reset();
55 
61  void pack(bl::gui::Box& container);
62 
63 private:
64  const Mode mode;
65  const bool showRandom;
66  bl::gui::TextEntry::Ptr hpEntry;
67  bl::gui::TextEntry::Ptr atkEntry;
68  bl::gui::TextEntry::Ptr defEntry;
69  bl::gui::TextEntry::Ptr spAtkEntry;
70  bl::gui::TextEntry::Ptr spDefEntry;
71  bl::gui::TextEntry::Ptr spdEntry;
72  bl::gui::Label::Ptr sumLabel;
73  unsigned int level;
74 
75  void onChange(bl::gui::Element* e);
76  void syncSum();
77 };
78 
79 } // namespace component
80 } // namespace editor
81 
82 #endif
All classes and functionality used for implementing the game editor.
Definition: Tile.hpp:11
Stats for Peoplemon. This struct is used for base stats, EVs, IVs, battle increases/decreases,...
Definition: Stats.hpp:19
Provides an inline GUI entry for stats in either EV mode or IV mode.
Definition: StatBox.hpp:17
void pack(bl::gui::Box &container)
Packs the GUI elements into the given container.
Definition: StatBox.cpp:111
void reset()
Resets all stats to 0.
Definition: StatBox.cpp:74
core::pplmn::Stats currentValue() const
Returns the current Stats value entered.
Definition: StatBox.cpp:83
Mode
Mode the entry is in.
Definition: StatBox.hpp:20
StatBox(Mode mode, bool showRandomBut=true)
Construct a new Stat Box component.
Definition: StatBox.cpp:35
void notifyLevel(unsigned int level)
Make the statbox aware of the level of the peoplemon it is editing. Used for random EV generation.
Definition: StatBox.cpp:109
void update(const core::pplmn::Stats &value)
Updates the GUI elements with the given value.
Definition: StatBox.cpp:94