OpenTTD
linkgraph_type.h
Go to the documentation of this file.
1 /* $Id: linkgraph_type.h 26549 2014-05-01 14:50:52Z fonsinchen $ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * 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.
6  * 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.
7  * 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/>.
8  */
9 
12 #ifndef LINKGRAPH_TYPE_H
13 #define LINKGRAPH_TYPE_H
14 
15 typedef uint16 LinkGraphID;
16 static const LinkGraphID INVALID_LINK_GRAPH = UINT16_MAX;
17 
18 typedef uint16 LinkGraphJobID;
19 static const LinkGraphID INVALID_LINK_GRAPH_JOB = UINT16_MAX;
20 
21 typedef uint16 NodeID;
22 static const NodeID INVALID_NODE = UINT16_MAX;
23 
25  DT_BEGIN = 0,
26  DT_MIN = 0,
27  DT_MANUAL = 0,
31  DT_MAX = 2,
32  DT_NUM = 3,
33  DT_END = 3
34 };
35 
36 /* It needs to be 8bits, because we save and load it as such
37  * Define basic enum properties
38  */
39 template <> struct EnumPropsT<DistributionType> : MakeEnumPropsT<DistributionType, byte, DT_BEGIN, DT_END, DT_NUM> {};
40 typedef TinyEnumT<DistributionType> DistributionTypeByte; // typedefing-enumification of DistributionType
41 
57  EUM_REFRESH = 1 << 1,
58  EUM_RESTRICTED = 1 << 2,
59  EUM_UNRESTRICTED = 1 << 3,
60 };
61 
63 
64 #endif /* LINKGRAPH_TYPE_H */
Helper template class that makes basic properties of given enumeration type visible from outsize...
Definition: enum_type.hpp:66
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Increase capacity.
Manual distribution. No link graph calculations are run.
Symmetric distribution. The same amount of cargo travels in each direction between each pair of nodes...
Asymmetric distribution. Usually cargo will only travel in one direction.
Refresh capacity.
Informative template class exposing basic enumeration properties used by several other templates belo...
Definition: enum_type.hpp:52
Use restricted link.
DistributionType
EdgeUpdateMode
Special modes for updating links.
Use unrestricted link.
Maximum non-symmetric distribution.