Peoplemon  0.1.0
Peoplemon 3 game source documentation
CharacterSpawn.hpp
Go to the documentation of this file.
1 #ifndef CORE_MAPS_CHARACTERSPAWN_HPP
2 #define CORE_MAPS_CHARACTERSPAWN_HPP
3 
4 #include <BLIB/Serialization.hpp>
5 #include <BLIB/Tilemap/Position.hpp>
6 #include <SFML/Graphics.hpp>
7 #include <string>
8 
9 namespace core
10 {
11 namespace map
12 {
20  bl::tmap::Position position;
21  std::string file;
22 
27  CharacterSpawn() = default;
28 
35  CharacterSpawn(const bl::tmap::Position& pos, const std::string& file)
36  : position(pos)
37  , file(file) {}
38 };
39 
40 } // namespace map
41 } // namespace core
42 
43 namespace bl
44 {
45 namespace serial
46 {
47 template<>
48 struct SerializableObject<core::map::CharacterSpawn> : public SerializableObjectBase {
49  SerializableField<1, core::map::CharacterSpawn, bl::tmap::Position> position;
50  SerializableField<2, core::map::CharacterSpawn, std::string> file;
51 
53  : SerializableObjectBase("CharacterSpawn")
54  , position("position", *this, &core::map::CharacterSpawn::position,
55  SerializableFieldBase::Required{})
56  , file("file", *this, &core::map::CharacterSpawn::file, SerializableFieldBase::Required{}) {}
57 };
58 
59 } // namespace serial
60 } // namespace bl
61 
62 #endif
Core classes and functionality for both the editor and game.
Represents a character to be spawned into a map on load.
CharacterSpawn()=default
Construct a new Character Spawn object.
CharacterSpawn(const bl::tmap::Position &pos, const std::string &file)
Construct a new Character Spawn object.
bl::tmap::Position position
SerializableField< 1, core::map::CharacterSpawn, bl::tmap::Position > position
SerializableField< 2, core::map::CharacterSpawn, std::string > file