OpenTTD Source: src/linkgraph/linkgraph_type.h Source File

OpenTTD Source 13.1

linkgraph_type.h
Go to the documentation of this file.
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
7
10 #ifndef LINKGRAPH_TYPE_H
11 #define LINKGRAPH_TYPE_H
12
13 typedef uint16 LinkGraphID;
14 static const LinkGraphID INVALID_LINK_GRAPH = UINT16_MAX;
15
16 typedef uint16 LinkGraphJobID;
17 static const LinkGraphID INVALID_LINK_GRAPH_JOB = UINT16_MAX;
18
19 typedef uint16 NodeID;
20 static const NodeID INVALID_NODE = UINT16_MAX;
21
22 enum DistributionType : byte {
23 DT_BEGIN = 0,
24 DT_MIN = 0,
25 DT_MANUAL = 0,
26 DT_ASYMMETRIC = 1,
27 DT_MAX_NONSYMMETRIC = 1,
28 DT_SYMMETRIC = 2,
29 DT_MAX = 2,
30 DT_NUM = 3,
31 DT_END = 3
32 };
33
34 /* It needs to be 8bits, because we save and load it as such
35 * Define basic enum properties
36 */
37 template <> struct EnumPropsT<DistributionType> : MakeEnumPropsT<DistributionType, byte, DT_BEGIN, DT_END, DT_NUM> {};
38
52 enum EdgeUpdateMode {
53 EUM_INCREASE = 1,
54 EUM_REFRESH = 1 << 1,
55 EUM_RESTRICTED = 1 << 2,
56 EUM_UNRESTRICTED = 1 << 3,
57 };
58
59 DECLARE_ENUM_AS_BIT_SET(EdgeUpdateMode)
60
61 #endif /* LINKGRAPH_TYPE_H */
DT_SYMMETRIC
@ DT_SYMMETRIC
Symmetric distribution. The same amount of cargo travels in each direction between each pair of nodes...
Definition: linkgraph_type.h:28
EUM_UNRESTRICTED
@ EUM_UNRESTRICTED
Use unrestricted link.
Definition: linkgraph_type.h:56
DT_MANUAL
@ DT_MANUAL
Manual distribution. No link graph calculations are run.
Definition: linkgraph_type.h:25
EUM_INCREASE
@ EUM_INCREASE
Increase capacity.
Definition: linkgraph_type.h:53
DT_ASYMMETRIC
@ DT_ASYMMETRIC
Asymmetric distribution. Usually cargo will only travel in one direction.
Definition: linkgraph_type.h:26
EdgeUpdateMode
EdgeUpdateMode
Special modes for updating links.
Definition: linkgraph_type.h:52
EnumPropsT
Informative template class exposing basic enumeration properties used by several other templates belo...
Definition: enum_type.hpp:48
EUM_REFRESH
@ EUM_REFRESH
Refresh capacity.
Definition: linkgraph_type.h:54
EUM_RESTRICTED
@ EUM_RESTRICTED
Use restricted link.
Definition: linkgraph_type.h:55
MakeEnumPropsT
Helper template class that makes basic properties of given enumeration type visible from outsize.
Definition: enum_type.hpp:62
DECLARE_ENUM_AS_BIT_SET
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Definition: company_manager_face.h:29
DT_MAX_NONSYMMETRIC
@ DT_MAX_NONSYMMETRIC
Maximum non-symmetric distribution.
Definition: linkgraph_type.h:27
DistributionType
DistributionType
Definition: linkgraph_type.h:22