Peoplemon  0.1.0
Peoplemon 3 game source documentation
CatchRegion.hpp
Go to the documentation of this file.
1 #ifndef CORE_MAPS_CATCHREGION_HPP
2 #define CORE_MAPS_CATCHREGION_HPP
3 
5 #include <vector>
6 
7 namespace core
8 {
9 namespace map
10 {
18 struct CatchRegion {
19  std::string name;
20  std::vector<pplmn::WildPeoplemon> wilds;
21 
28  const pplmn::WildPeoplemon& selectWild() const;
29 };
30 
31 } // namespace map
32 } // namespace core
33 
34 namespace bl
35 {
36 namespace serial
37 {
38 template<>
39 struct SerializableObject<core::map::CatchRegion> : public SerializableObjectBase {
42 
43  SerializableField<1, Region, std::string> name;
44  SerializableField<2, Region, std::vector<Wild>> wilds;
45 
47  : SerializableObjectBase("CatchRegion")
48  , name("name", *this, &Region::name, SerializableFieldBase::Required{})
49  , wilds("wilds", *this, &Region::wilds, SerializableFieldBase::Required{}) {}
50 };
51 
52 } // namespace serial
53 } // namespace bl
54 
55 #endif
Core classes and functionality for both the editor and game.
Represents a class of catchable peoplemon.
Definition: CatchRegion.hpp:18
const pplmn::WildPeoplemon & selectWild() const
Selects a wild peoplemon from the set based on frequency, or returns a level 100 Ben if the set is em...
Definition: CatchRegion.cpp:16
std::vector< pplmn::WildPeoplemon > wilds
Definition: CatchRegion.hpp:20
SerializableField< 2, Region, std::vector< Wild > > wilds
Definition: CatchRegion.hpp:44
SerializableField< 1, Region, std::string > name
Definition: CatchRegion.hpp:43
Template struct to generate OwnedPeoplemon for random encounters.