Peoplemon  0.1.0
Peoplemon 3 game source documentation
StoredPeoplemon.hpp
Go to the documentation of this file.
1 #ifndef CORE_PEOPLEMON_STOREDPEOPLEMON_HPP
2 #define CORE_PEOPLEMON_STOREDPEOPLEMON_HPP
3 
4 #include <BLIB/Serialization.hpp>
6 #include <SFML/System/Vector2.hpp>
7 
8 namespace core
9 {
10 namespace pplmn
11 {
21 
23  std::uint16_t boxNumber;
24 
26  sf::Vector2i position;
27 
32  StoredPeoplemon() = default;
33 
41  StoredPeoplemon(const OwnedPeoplemon& ppl, std::uint16_t box, const sf::Vector2i& pos)
42  : peoplemon(ppl)
43  , boxNumber(box)
44  , position(pos) {}
45 };
46 
47 } // namespace pplmn
48 } // namespace core
49 
50 namespace bl
51 {
52 namespace serial
53 {
54 template<>
55 struct SerializableObject<core::pplmn::StoredPeoplemon> : public SerializableObjectBase {
58 
59  SerializableField<1, SP, OP> peoplemon;
60  SerializableField<2, SP, std::uint16_t> boxNumber;
61  SerializableField<3, SP, sf::Vector2i> position;
62 
64  : SerializableObjectBase("StoredPeoplemon")
65  , peoplemon("peoplemon", *this, &SP::peoplemon, SerializableFieldBase::Required{})
66  , boxNumber("boxNumber", *this, &SP::boxNumber, SerializableFieldBase::Required{})
67  , position("position", *this, &SP::position, SerializableFieldBase::Required{}) {}
68 };
69 
70 } // namespace serial
71 } // namespace bl
72 
73 #endif
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....
Represents a Peoplemon in storage.
StoredPeoplemon(const OwnedPeoplemon &ppl, std::uint16_t box, const sf::Vector2i &pos)
Construct a new Stored Peoplemon.
OwnedPeoplemon peoplemon
The peoplemon itself.
std::uint16_t boxNumber
Which box the peoplemon is in.
sf::Vector2i position
The position of the peoplemon in the box.
StoredPeoplemon()=default
Construct a new Stored Peoplemon.