OpenTTD Source: src/league_type.h Source File

OpenTTD Source 14.1

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 <http://www.gnu.org/licenses/>.
6 */
7
10 #ifndef LEAGUE_TYPE_H
11 #define LEAGUE_TYPE_H
12
14 enum LinkType : byte {
15 LT_NONE = 0,
16 LT_TILE = 1,
17 LT_INDUSTRY = 2,
18 LT_TOWN = 3,
19 LT_COMPANY = 4,
20 LT_STORY_PAGE = 5,
21 };
22
23 typedef uint32_t LinkTargetID;
24
25 struct Link {
26 LinkType type;
27 LinkTargetID target;
28 Link(LinkType type, LinkTargetID target): type{type}, target{target} {}
29 Link(): Link(LT_NONE, 0) {}
30 };
31
32 typedef uint8_t LeagueTableID;
33 struct LeagueTable;
34 static const LeagueTableID INVALID_LEAGUE_TABLE = 0xFF;
35
36 typedef uint16_t LeagueTableElementID;
37 struct LeagueTableElement;
38 static const LeagueTableElementID INVALID_LEAGUE_TABLE_ELEMENT = 0xFFFF;
39
40 #endif /* LEAGUE_TYPE_H */
INVALID_LEAGUE_TABLE
static const LeagueTableID INVALID_LEAGUE_TABLE
Invalid/unknown index of LeagueTable.
Definition: league_type.h:34
LeagueTableElement
Struct about league table elements.
Definition: league_base.h:31
LeagueTable
Struct about custom league tables.
Definition: league_base.h:52
LT_INDUSTRY
@ LT_INDUSTRY
Link an industry.
Definition: league_type.h:17
LT_NONE
@ LT_NONE
No link.
Definition: league_type.h:15
LinkType
LinkType
Types of the possible link targets.
Definition: league_type.h:14
LT_STORY_PAGE
@ LT_STORY_PAGE
Link a story page.
Definition: league_type.h:20
LeagueTableID
uint8_t LeagueTableID
ID of a league table.
Definition: league_type.h:32
LT_TILE
@ LT_TILE
Link a tile.
Definition: league_type.h:16
LT_TOWN
@ LT_TOWN
Link a town.
Definition: league_type.h:18
INVALID_LEAGUE_TABLE_ELEMENT
static const LeagueTableElementID INVALID_LEAGUE_TABLE_ELEMENT
Invalid/unknown index of LeagueTableElement.
Definition: league_type.h:38
LeagueTableElementID
uint16_t LeagueTableElementID
ID of a league table element.
Definition: league_type.h:36
Link
Definition: league_type.h:25
LinkTargetID
uint32_t LinkTargetID
Contains either tile, industry ID, town ID, story page ID or company ID.
Definition: league_type.h:23
LT_COMPANY
@ LT_COMPANY
Link a company.
Definition: league_type.h:19