OpenTTD Source: src/league_type.h Source File

OpenTTD Source 15.0-RC2

league_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 LEAGUE_TYPE_H
11#define LEAGUE_TYPE_H
12
13#include "core/pool_type.hpp"
14
16 enum LinkType : uint8_t {
17 LT_NONE = 0,
18 LT_TILE = 1,
19 LT_INDUSTRY = 2,
20 LT_TOWN = 3,
21 LT_COMPANY = 4,
22 LT_STORY_PAGE = 5,
23};
24
25 typedef uint32_t LinkTargetID;
26
27 struct Link {
28 LinkType type = LT_NONE;
29 LinkTargetID target = 0;
30
31 Link() {}
32 Link(LinkType type, LinkTargetID target) : type{type}, target{target} {}
33};
34
35 using LeagueTableID = PoolID<uint8_t, struct LeagueTableIDTag, 255, 0xFF>;
36struct LeagueTable;
37
38 using LeagueTableElementID = PoolID<uint16_t, struct LeagueTableElementIDTag, 64000, 0xFFFF>;
39struct LeagueTableElement;
40
41#endif /* LEAGUE_TYPE_H */
LinkType
LinkType
Types of the possible link targets.
Definition league_type.h:16
LT_COMPANY
@ LT_COMPANY
Link a company.
Definition league_type.h:21
LT_STORY_PAGE
@ LT_STORY_PAGE
Link a story page.
Definition league_type.h:22
LT_TILE
@ LT_TILE
Link a tile.
Definition league_type.h:18
LT_NONE
@ LT_NONE
No link.
Definition league_type.h:17
LT_INDUSTRY
@ LT_INDUSTRY
Link an industry.
Definition league_type.h:19
LT_TOWN
@ LT_TOWN
Link a town.
Definition league_type.h:20
LinkTargetID
uint32_t LinkTargetID
Contains either tile, industry ID, town ID, story page ID or company ID.
Definition league_type.h:25
pool_type.hpp
Definition of Pool, structure used to access PoolItems, and PoolItem, base structure for Vehicle,...
LeagueTableElement
Struct about league table elements.
Definition league_base.h:32
LeagueTable
Struct about custom league tables.
Definition league_base.h:55
Link
Definition league_type.h:27
PoolID< uint8_t, struct LeagueTableIDTag, 255, 0xFF >