Peoplemon  0.1.0
Peoplemon 3 game source documentation
WildPeoplemon.hpp
Go to the documentation of this file.
1 #ifndef CORE_PEOPLEMON_WILDPEOPLEMON_HPP
2 #define CORE_PEOPLEMON_WILDPEOPLEMON_HPP
3 
4 #include <BLIB/Serialization.hpp>
6 #include <cstdint>
7 
8 namespace core
9 {
10 namespace pplmn
11 {
18 struct WildPeoplemon {
20  Id id;
21 
23  std::uint8_t minLevel;
24 
26  std::uint8_t maxLevel;
27 
29  std::uint16_t frequency;
30 
35  OwnedPeoplemon generate() const;
36 };
37 
38 } // namespace pplmn
39 } // namespace core
40 
41 namespace bl
42 {
43 namespace serial
44 {
45 template<>
46 struct SerializableObject<core::pplmn::WildPeoplemon> : public SerializableObjectBase {
48 
49  SerializableField<1, Wild, std::uint8_t> minLevel;
50  SerializableField<2, Wild, std::uint8_t> maxLevel;
51  SerializableField<3, Wild, std::uint16_t> freq;
52  SerializableField<4, Wild, core::pplmn::Id> id;
53 
55  : SerializableObjectBase("WildPeoplemon")
56  , minLevel("minLevel", *this, &Wild::minLevel, SerializableFieldBase::Required{})
57  , maxLevel("maxLevel", *this, &Wild::maxLevel, SerializableFieldBase::Required{})
58  , freq("freq", *this, &Wild::frequency, SerializableFieldBase::Required{})
59  , id("id", *this, &Wild::id, SerializableFieldBase::Required{}) {}
60 };
61 
62 } // namespace serial
63 } // namespace bl
64 
65 #endif
Id
The id of a peoplemon.
Definition: Id.hpp:16
Core classes and functionality for both the editor and game.
Represents an instance of a peoplemon. Can be a wild peoplemon, trainer, or player peoplemon....
Template struct to generate OwnedPeoplemon for random encounters.
Id id
The type of peoplemon to generate.
std::uint8_t minLevel
The minimum level that may spawn, inclusive.
std::uint8_t maxLevel
The maximum level that may spawn, inclusive.
std::uint16_t frequency
Frequency of spawns relative to other wild peoplemon in the region.
OwnedPeoplemon generate() const
Generate an OwnedPeoplemon from the template.
SerializableField< 3, Wild, std::uint16_t > freq
SerializableField< 2, Wild, std::uint8_t > maxLevel
SerializableField< 1, Wild, std::uint8_t > minLevel
SerializableField< 4, Wild, core::pplmn::Id > id