Peoplemon  0.1.0
Peoplemon 3 game source documentation
Spawn.hpp
Go to the documentation of this file.
1 #ifndef CORE_MAPS_SPAWN_HPP
2 #define CORE_MAPS_SPAWN_HPP
3 
4 #include <BLIB/Serialization.hpp>
5 #include <BLIB/Tilemap/Position.hpp>
6 #include <SFML/Graphics.hpp>
7 #include <cstdint>
8 
9 namespace core
10 {
11 namespace map
12 {
19 struct Spawn {
20  std::uint16_t id;
21  bl::tmap::Position position;
22 
27  Spawn();
28 
35  Spawn(std::uint16_t id, const bl::tmap::Position& position);
36 };
37 
38 } // namespace map
39 } // namespace core
40 
41 namespace bl
42 {
43 namespace serial
44 {
45 template<>
46 struct SerializableObject<core::map::Spawn> : public SerializableObjectBase {
47  SerializableField<1, core::map::Spawn, std::uint16_t> id;
48  SerializableField<2, core::map::Spawn, bl::tmap::Position> position;
49 
51  : SerializableObjectBase("Spawn")
52  , id("id", *this, &core::map::Spawn::id, SerializableFieldBase::Required{})
53  , position("position", *this, &core::map::Spawn::position, SerializableFieldBase::Required{}) {}
54 };
55 
56 } // namespace serial
57 } // namespace bl
58 
59 #endif
Core classes and functionality for both the editor and game.
Basic struct representing a spawn in a Map.
Definition: Spawn.hpp:19
std::uint16_t id
Definition: Spawn.hpp:20
bl::tmap::Position position
Definition: Spawn.hpp:21
Spawn()
Creates an empty spawn.
Definition: Spawn.cpp:7
SerializableField< 2, core::map::Spawn, bl::tmap::Position > position
Definition: Spawn.hpp:48
SerializableField< 1, core::map::Spawn, std::uint16_t > id
Definition: Spawn.hpp:47