Symphony Of Empires
objects.hpp
Go to the documentation of this file.
1
// Symphony of Empires
2
// Copyright (C) 2021, Symphony of Empires contributors
3
//
4
// This program is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
//
17
// ----------------------------------------------------------------------------
18
// Name:
19
// objects.hpp
20
//
21
// Abstract:
22
// Does some important stuff.
23
// ----------------------------------------------------------------------------
24
25
#pragma once
26
27
#include <cstdint>
28
#include "eng3d/entity.hpp"
29
#include "eng3d/serializer.hpp"
30
31
struct
CommodityId
:
EntityId
<uint8_t> {
32
CommodityId
() =
default
;
33
CommodityId
(
size_t
_id) :
EntityId
(_id) {}
34
};
35
template
<>
36
struct
Eng3D::Deser::Serializer
<
CommodityId
> :
Eng3D::Deser::SerializerMemcpy
<CommodityId> {};
37
38
struct
ProductId
:
EntityId
<uint8_t> {
39
ProductId
() =
default
;
40
ProductId
(
size_t
_id) :
EntityId
(_id) {}
41
};
42
template
<>
43
struct
Eng3D::Deser::Serializer
<
ProductId
> :
Eng3D::Deser::SerializerMemcpy
<ProductId> {};
44
45
struct
LanguageId
:
EntityId
<uint16_t> {
46
LanguageId
() =
default
;
47
LanguageId
(
size_t
_id) :
EntityId
(_id) {}
48
};
49
template
<>
50
struct
Eng3D::Deser::Serializer
<
LanguageId
> :
Eng3D::Deser::SerializerMemcpy
<LanguageId> {};
51
52
struct
ReligionId
:
EntityId
<uint8_t> {
53
ReligionId
() =
default
;
54
ReligionId
(
size_t
_id) :
EntityId
(_id) {}
55
};
56
template
<>
57
struct
Eng3D::Deser::Serializer
<
ReligionId
> :
Eng3D::Deser::SerializerMemcpy
<ReligionId> {};
58
59
struct
PopTypeId
:
EntityId
<uint8_t> {
60
PopTypeId
() =
default
;
61
PopTypeId
(
size_t
_id) :
EntityId
(_id) {}
62
};
63
template
<>
64
struct
Eng3D::Deser::Serializer
<
PopTypeId
> :
Eng3D::Deser::SerializerMemcpy
<PopTypeId> {};
65
66
struct
PopId
:
EntityId
<uint8_t> {
67
PopId
() =
default
;
68
PopId
(
size_t
_id) :
EntityId
(_id) {}
69
};
70
template
<>
71
struct
Eng3D::Deser::Serializer
<
PopId
> :
Eng3D::Deser::SerializerMemcpy
<PopId> {};
72
73
struct
BuildingTypeId
:
EntityId
<uint8_t> {
74
BuildingTypeId
() =
default
;
75
BuildingTypeId
(
size_t
_id) :
EntityId
(_id) {}
76
};
77
template
<>
78
struct
Eng3D::Deser::Serializer
<
BuildingTypeId
> :
Eng3D::Deser::SerializerMemcpy
<BuildingTypeId> {};
79
80
struct
WarId
:
EntityId
<uint8_t> {
81
WarId
() =
default
;
82
WarId
(
size_t
_id) :
EntityId
(_id) {}
83
};
84
template
<>
85
struct
Eng3D::Deser::Serializer
<
WarId
> :
Eng3D::Deser::SerializerMemcpy
<WarId> {};
86
87
struct
DecisionId
:
EntityId
<uint8_t> {
88
DecisionId
() =
default
;
89
DecisionId
(
size_t
_id) :
EntityId
(_id) {}
90
};
91
template
<>
92
struct
Eng3D::Deser::Serializer
<
DecisionId
> :
Eng3D::Deser::SerializerMemcpy
<DecisionId> {};
93
94
struct
EventId
:
EntityId
<uint16_t> {
95
EventId
() =
default
;
96
EventId
(
size_t
_id) :
EntityId
(_id) {}
97
};
98
template
<>
99
struct
Eng3D::Deser::Serializer
<
EventId
> :
Eng3D::Deser::SerializerMemcpy
<EventId> {};
100
101
struct
NationId
:
EntityId
<uint16_t> {
102
NationId
() =
default
;
103
NationId
(
size_t
_id) :
EntityId
(_id) {}
104
};
105
template
<>
106
struct
Eng3D::Deser::Serializer
<
NationId
> :
Eng3D::Deser::SerializerMemcpy
<NationId> {};
107
108
struct
ProvinceId
:
EntityId
<uint16_t> {
109
ProvinceId
() =
default
;
110
ProvinceId
(
size_t
_id) :
EntityId
(_id) {}
111
};
112
template
<>
113
struct
Eng3D::Deser::Serializer
<
ProvinceId
> :
Eng3D::Deser::SerializerMemcpy
<ProvinceId> {};
114
115
struct
TechnologyId
:
EntityId
<uint8_t> {
116
TechnologyId
() =
default
;
117
TechnologyId
(
size_t
_id) :
EntityId
(_id) {}
118
};
119
template
<>
120
struct
Eng3D::Deser::Serializer
<
TechnologyId
> :
Eng3D::Deser::SerializerMemcpy
<TechnologyId> {};
121
122
struct
TerrainTypeId
:
EntityId
<uint8_t> {
123
TerrainTypeId
() =
default
;
124
TerrainTypeId
(
size_t
_id) :
EntityId
(_id) {}
125
};
126
template
<>
127
struct
Eng3D::Deser::Serializer
<
TerrainTypeId
> :
Eng3D::Deser::SerializerMemcpy
<TerrainTypeId> {};
128
129
struct
TreatyId
:
EntityId
<uint16_t> {
130
TreatyId
() =
default
;
131
TreatyId
(
size_t
_id) :
EntityId
(_id) {}
132
};
133
template
<>
134
struct
Eng3D::Deser::Serializer
<
TreatyId
> :
Eng3D::Deser::SerializerMemcpy
<TreatyId> {};
135
136
struct
UnitTypeId
:
EntityId
<uint8_t> {
137
UnitTypeId
() =
default
;
138
UnitTypeId
(
size_t
_id) :
EntityId
(_id) {}
139
};
140
template
<>
141
struct
Eng3D::Deser::Serializer
<
UnitTypeId
> :
Eng3D::Deser::SerializerMemcpy
<UnitTypeId> {};
142
143
struct
UnitId
:
EntityId
<uint16_t> {
144
UnitId
() =
default
;
145
UnitId
(
size_t
_id) :
EntityId
(_id) {}
146
};
147
template
<>
148
struct
Eng3D::Deser::Serializer
<
UnitId
> :
Eng3D::Deser::SerializerMemcpy
<UnitId> {};
149
150
struct
IdeologyId
:
EntityId
<uint8_t> {
151
IdeologyId
() =
default
;
152
IdeologyId
(
size_t
_id) :
EntityId
(_id) {}
153
};
154
template
<>
155
struct
Eng3D::Deser::Serializer
<
IdeologyId
> :
Eng3D::Deser::SerializerMemcpy
<IdeologyId> {};
156
157
struct
SubideologyId
:
EntityId
<uint8_t> {
158
SubideologyId
() =
default
;
159
SubideologyId
(
size_t
_id) :
EntityId
(_id) {}
160
};
161
template
<>
162
struct
Eng3D::Deser::Serializer
<
SubideologyId
> :
Eng3D::Deser::SerializerMemcpy
<SubideologyId> {};
163
164
struct
BuildingId
:
EntityId
<uint8_t> {
165
BuildingId
() =
default
;
166
BuildingId
(
size_t
_id) :
EntityId
(_id) {}
167
};
168
template
<>
169
struct
Eng3D::Deser::Serializer
<
BuildingId
> :
Eng3D::Deser::SerializerMemcpy
<BuildingId> {};
170
171
class
World
;
World
Definition:
world.hpp:114
BuildingId
Definition:
objects.hpp:164
BuildingId::BuildingId
BuildingId(size_t _id)
Definition:
objects.hpp:166
BuildingId::BuildingId
BuildingId()=default
BuildingTypeId
Definition:
objects.hpp:73
BuildingTypeId::BuildingTypeId
BuildingTypeId()=default
BuildingTypeId::BuildingTypeId
BuildingTypeId(size_t _id)
Definition:
objects.hpp:75
CommodityId
Definition:
objects.hpp:31
CommodityId::CommodityId
CommodityId(size_t _id)
Definition:
objects.hpp:33
CommodityId::CommodityId
CommodityId()=default
DecisionId
Definition:
objects.hpp:87
DecisionId::DecisionId
DecisionId()=default
DecisionId::DecisionId
DecisionId(size_t _id)
Definition:
objects.hpp:89
Eng3D::Deser::Serializer
A serializer (base class) which can be used to serialize objects and create per-object optimized clas...
Definition:
serializer.hpp:111
Eng3D::Deser::SerializerMemcpy
A serializer optimized to memcpy directly the element into the byte stream use only when the object c...
Definition:
serializer.hpp:162
EntityId
Definition:
entity.hpp:32
EventId
Definition:
objects.hpp:94
EventId::EventId
EventId()=default
EventId::EventId
EventId(size_t _id)
Definition:
objects.hpp:96
IdeologyId
Definition:
objects.hpp:150
IdeologyId::IdeologyId
IdeologyId(size_t _id)
Definition:
objects.hpp:152
IdeologyId::IdeologyId
IdeologyId()=default
LanguageId
Definition:
objects.hpp:45
LanguageId::LanguageId
LanguageId()=default
LanguageId::LanguageId
LanguageId(size_t _id)
Definition:
objects.hpp:47
NationId
Definition:
objects.hpp:101
NationId::NationId
NationId(size_t _id)
Definition:
objects.hpp:103
NationId::NationId
NationId()=default
PopId
Definition:
objects.hpp:66
PopId::PopId
PopId()=default
PopId::PopId
PopId(size_t _id)
Definition:
objects.hpp:68
PopTypeId
Definition:
objects.hpp:59
PopTypeId::PopTypeId
PopTypeId()=default
PopTypeId::PopTypeId
PopTypeId(size_t _id)
Definition:
objects.hpp:61
ProductId
Definition:
objects.hpp:38
ProductId::ProductId
ProductId(size_t _id)
Definition:
objects.hpp:40
ProductId::ProductId
ProductId()=default
ProvinceId
Definition:
objects.hpp:108
ProvinceId::ProvinceId
ProvinceId()=default
ProvinceId::ProvinceId
ProvinceId(size_t _id)
Definition:
objects.hpp:110
ReligionId
Definition:
objects.hpp:52
ReligionId::ReligionId
ReligionId()=default
ReligionId::ReligionId
ReligionId(size_t _id)
Definition:
objects.hpp:54
SubideologyId
Definition:
objects.hpp:157
SubideologyId::SubideologyId
SubideologyId()=default
SubideologyId::SubideologyId
SubideologyId(size_t _id)
Definition:
objects.hpp:159
TechnologyId
Definition:
objects.hpp:115
TechnologyId::TechnologyId
TechnologyId(size_t _id)
Definition:
objects.hpp:117
TechnologyId::TechnologyId
TechnologyId()=default
TerrainTypeId
Definition:
objects.hpp:122
TerrainTypeId::TerrainTypeId
TerrainTypeId(size_t _id)
Definition:
objects.hpp:124
TerrainTypeId::TerrainTypeId
TerrainTypeId()=default
TreatyId
Definition:
objects.hpp:129
TreatyId::TreatyId
TreatyId()=default
TreatyId::TreatyId
TreatyId(size_t _id)
Definition:
objects.hpp:131
UnitId
Definition:
objects.hpp:143
UnitId::UnitId
UnitId(size_t _id)
Definition:
objects.hpp:145
UnitId::UnitId
UnitId()=default
UnitTypeId
Definition:
objects.hpp:136
UnitTypeId::UnitTypeId
UnitTypeId(size_t _id)
Definition:
objects.hpp:138
UnitTypeId::UnitTypeId
UnitTypeId()=default
WarId
Definition:
objects.hpp:80
WarId::WarId
WarId(size_t _id)
Definition:
objects.hpp:82
WarId::WarId
WarId()=default
game
src
objects.hpp
Generated by
1.9.1