OpenTTD Source  20241108-master-g80f628063a
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 : uint8_t {
15  LT_NONE = 0,
16  LT_TILE = 1,
18  LT_TOWN = 3,
19  LT_COMPANY = 4,
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;
39 
40 #endif /* LEAGUE_TYPE_H */
static const LeagueTableElementID INVALID_LEAGUE_TABLE_ELEMENT
Invalid/unknown index of LeagueTableElement.
Definition: league_type.h:38
uint16_t LeagueTableElementID
ID of a league table element.
Definition: league_type.h:36
uint8_t LeagueTableID
ID of a league table.
Definition: league_type.h:32
LinkType
Types of the possible link targets.
Definition: league_type.h:14
@ LT_COMPANY
Link a company.
Definition: league_type.h:19
@ LT_STORY_PAGE
Link a story page.
Definition: league_type.h:20
@ LT_TILE
Link a tile.
Definition: league_type.h:16
@ LT_NONE
No link.
Definition: league_type.h:15
@ LT_INDUSTRY
Link an industry.
Definition: league_type.h:17
@ LT_TOWN
Link a town.
Definition: league_type.h:18
uint32_t LinkTargetID
Contains either tile, industry ID, town ID, story page ID or company ID.
Definition: league_type.h:23
static const LeagueTableID INVALID_LEAGUE_TABLE
Invalid/unknown index of LeagueTable.
Definition: league_type.h:34
Struct about league table elements.
Definition: league_base.h:31
Struct about custom league tables.
Definition: league_base.h:52