OpenTTD Source 20250312-master-gcdcc6b491d
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#include "../core/pool_type.hpp"
14
17
18typedef uint16_t NodeID;
19static const NodeID INVALID_NODE = UINT16_MAX;
20
21enum DistributionType : uint8_t {
22 DT_BEGIN = 0,
23 DT_MIN = 0,
28 DT_MAX = 2,
29 DT_NUM = 3,
30 DT_END = 3
31};
32
46enum EdgeUpdateMode : uint8_t {
48 EUM_REFRESH = 1 << 1,
49 EUM_RESTRICTED = 1 << 2,
51};
52
54
55#endif /* LINKGRAPH_TYPE_H */
#define DECLARE_ENUM_AS_BIT_SET(enum_type)
Operators to allow to work with enum as with type safe bit set in C++.
Definition enum_type.hpp:70
EdgeUpdateMode
Special modes for updating links.
@ EUM_REFRESH
Refresh capacity.
@ EUM_INCREASE
Increase capacity.
@ EUM_RESTRICTED
Use restricted link.
@ EUM_UNRESTRICTED
Use unrestricted link.
DistributionType
@ DT_MANUAL
Manual distribution. No link graph calculations are run.
@ DT_ASYMMETRIC
Asymmetric distribution. Usually cargo will only travel in one direction.
@ DT_SYMMETRIC
Symmetric distribution. The same amount of cargo travels in each direction between each pair of nodes...
@ DT_MAX_NONSYMMETRIC
Maximum non-symmetric distribution.