Peoplemon  0.1.0
Peoplemon 3 game source documentation
Town.hpp
Go to the documentation of this file.
1 #ifndef CORE_MAPS_TOWN_HPP
2 #define CORE_MAPS_TOWN_HPP
3 
4 #include <BLIB/Serialization.hpp>
5 #include <Core/Maps/Weather.hpp>
7 #include <string>
8 #include <vector>
9 
10 namespace core
11 {
12 namespace map
13 {
22 struct Town {
23  std::string name;
24  std::string playlist;
26  std::uint16_t pcSpawn;
27  std::string description;
28  sf::Vector2i mapPos;
29 };
30 
31 } // namespace map
32 } // namespace core
33 
34 namespace bl
35 {
36 namespace serial
37 {
38 template<>
39 struct SerializableObject<core::map::Town> : public SerializableObjectBase {
43 
44  SerializableField<1, Town, std::string> name;
45  SerializableField<2, Town, std::string> playlist;
46  SerializableField<3, Town, Weather::Type> weather;
47  SerializableField<4, Town, std::uint16_t> pcSpawn;
48  SerializableField<5, Town, std::string> description;
49  SerializableField<6, Town, sf::Vector2i> mapPos;
50 
52  : SerializableObjectBase("Town")
53  , name("name", *this, &Town::name, SerializableFieldBase::Required{})
54  , playlist("playlist", *this, &Town::playlist, SerializableFieldBase::Required{})
55  , weather("weather", *this, &Town::weather, SerializableFieldBase::Required{})
56  , pcSpawn("pcSpawn", *this, &Town::pcSpawn, SerializableFieldBase::Required{})
57  , description("desc", *this, &Town::description, SerializableFieldBase::Optional{})
58  , mapPos("mapPos", *this, &Town::mapPos, SerializableFieldBase::Optional{}) {
59  description.setDefault("DESCRIPTION NOT SET");
60  mapPos.setDefault({-100, -100});
61  }
62 };
63 
64 } // namespace serial
65 } // namespace bl
66 
67 #endif
Core classes and functionality for both the editor and game.
Represents a town, route, or region within a map. Maps may have many towns. Individual tiles are asso...
Definition: Town.hpp:22
std::uint16_t pcSpawn
Definition: Town.hpp:26
sf::Vector2i mapPos
Definition: Town.hpp:28
std::string playlist
Definition: Town.hpp:24
Weather::Type weather
Definition: Town.hpp:25
std::string description
Definition: Town.hpp:27
std::string name
Definition: Town.hpp:23
SerializableField< 4, Town, std::uint16_t > pcSpawn
Definition: Town.hpp:47
SerializableField< 2, Town, std::string > playlist
Definition: Town.hpp:45
SerializableField< 6, Town, sf::Vector2i > mapPos
Definition: Town.hpp:49
SerializableField< 1, Town, std::string > name
Definition: Town.hpp:44
SerializableField< 5, Town, std::string > description
Definition: Town.hpp:48
SerializableField< 3, Town, Weather::Type > weather
Definition: Town.hpp:46
Parent weather system for maps. Manages active weather.
Definition: Weather.hpp:32
Type
The type of weather.
Definition: Weather.hpp:38
Template struct to generate OwnedPeoplemon for random encounters.