mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-08 23:19:40 +00:00
Codechange: strongly type LinkGraphID and LinkGraphJobID
This commit is contained in:
parent
6c8915fdbc
commit
c311e6e4a9
@ -24,7 +24,7 @@ class LinkGraph;
|
||||
* Type of the pool for link graph components. Each station can be in at up to
|
||||
* 32 link graphs. So we allow for plenty of them to be created.
|
||||
*/
|
||||
typedef Pool<LinkGraph, LinkGraphID, 32, 0xFFFF> LinkGraphPool;
|
||||
using LinkGraphPool = Pool<LinkGraph, LinkGraphID, 32, LinkGraphID::End().base()>;
|
||||
/** The actual pool with link graphs. */
|
||||
extern LinkGraphPool _link_graph_pool;
|
||||
|
||||
|
@ -10,11 +10,13 @@
|
||||
#ifndef LINKGRAPH_TYPE_H
|
||||
#define LINKGRAPH_TYPE_H
|
||||
|
||||
typedef uint16_t LinkGraphID;
|
||||
static const LinkGraphID INVALID_LINK_GRAPH = UINT16_MAX;
|
||||
#include "../core/pool_type.hpp"
|
||||
|
||||
typedef uint16_t LinkGraphJobID;
|
||||
static const LinkGraphJobID INVALID_LINK_GRAPH_JOB = UINT16_MAX;
|
||||
using LinkGraphID = PoolID<uint16_t, struct LinkGraphIDTag, 0xFFFF, 0xFFFF>;
|
||||
static constexpr LinkGraphID INVALID_LINK_GRAPH = LinkGraphID::Invalid();
|
||||
|
||||
using LinkGraphJobID = PoolID<uint16_t, struct LinkGraphJobIDTag, 0xFFFF, 0xFFFF>;
|
||||
static constexpr LinkGraphJobID INVALID_LINK_GRAPH_JOB = LinkGraphJobID::Invalid();
|
||||
|
||||
typedef uint16_t NodeID;
|
||||
static const NodeID INVALID_NODE = UINT16_MAX;
|
||||
|
@ -19,7 +19,7 @@ class Path;
|
||||
typedef std::list<Path *> PathList;
|
||||
|
||||
/** Type of the pool for link graph jobs. */
|
||||
typedef Pool<LinkGraphJob, LinkGraphJobID, 32, 0xFFFF> LinkGraphJobPool;
|
||||
using LinkGraphJobPool = Pool<LinkGraphJob, LinkGraphJobID, 32, LinkGraphJobID::End().base()>;
|
||||
/** The actual pool with link graph jobs. */
|
||||
extern LinkGraphJobPool _link_graph_job_pool;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user