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

OpenTTD Source 15.0-RC2

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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef LINKGRAPH_TYPE_H
11#define LINKGRAPH_TYPE_H
12
13#include "../core/pool_type.hpp"
14
15using LinkGraphID = PoolID<uint16_t, struct LinkGraphIDTag, 0xFFFF, 0xFFFF>;
16using LinkGraphJobID = PoolID<uint16_t, struct LinkGraphJobIDTag, 0xFFFF, 0xFFFF>;
17
18typedef uint16_t NodeID;
19static const NodeID INVALID_NODE = UINT16_MAX;
20
21 enum DistributionType : uint8_t {
22 DT_BEGIN = 0,
23 DT_MIN = 0,
24 DT_MANUAL = 0,
25 DT_ASYMMETRIC = 1,
26 DT_MAX_NONSYMMETRIC = 1,
27 DT_SYMMETRIC = 2,
28 DT_MAX = 2,
29 DT_NUM = 3,
30 DT_END = 3
31};
32
46 enum class EdgeUpdateMode : uint8_t {
47 Increase,
48 Refresh,
49 Restricted,
50 Unrestricted,
51};
52
53using EdgeUpdateModes = EnumBitSet<EdgeUpdateMode, uint8_t>;
54
55#endif /* LINKGRAPH_TYPE_H */
EnumBitSet
Enum-as-bit-set wrapper.
Definition enum_type.hpp:177
EdgeUpdateMode
EdgeUpdateMode
Special modes for updating links.
Definition linkgraph_type.h:46
EdgeUpdateMode::Refresh
@ Refresh
Refresh capacity.
EdgeUpdateMode::Unrestricted
@ Unrestricted
Use unrestricted link.
EdgeUpdateMode::Increase
@ Increase
Increase capacity.
EdgeUpdateMode::Restricted
@ Restricted
Use restricted link.
DistributionType
DistributionType
Definition linkgraph_type.h:21
DT_MANUAL
@ DT_MANUAL
Manual distribution. No link graph calculations are run.
Definition linkgraph_type.h:24
DT_ASYMMETRIC
@ DT_ASYMMETRIC
Asymmetric distribution. Usually cargo will only travel in one direction.
Definition linkgraph_type.h:25
DT_SYMMETRIC
@ DT_SYMMETRIC
Symmetric distribution. The same amount of cargo travels in each direction between each pair of nodes...
Definition linkgraph_type.h:27
DT_MAX_NONSYMMETRIC
@ DT_MAX_NONSYMMETRIC
Maximum non-symmetric distribution.
Definition linkgraph_type.h:26
PoolID< uint16_t, struct LinkGraphIDTag, 0xFFFF, 0xFFFF >