OpenTTD Source 20260311-master-g511d3794ce
object_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
9
10#ifndef OBJECT_TYPE_H
11#define OBJECT_TYPE_H
12
13#include "core/pool_type.hpp"
14
16typedef uint16_t ObjectType;
17
19static const ObjectType OBJECT_LIGHTHOUSE = 1;
20static const ObjectType OBJECT_STATUE = 2;
21static const ObjectType OBJECT_OWNED_LAND = 3;
22static const ObjectType OBJECT_HQ = 4;
23
24static const ObjectType NEW_OBJECT_OFFSET = 5;
25static const ObjectType NUM_OBJECTS = 64000;
27static const ObjectType INVALID_OBJECT_TYPE = 0xFFFF;
28
31
32struct Object;
33struct ObjectSpec;
34
41using ObjectAnimationTriggers = EnumBitSet<ObjectAnimationTrigger, uint16_t>;
42
43#endif /* OBJECT_TYPE_H */
Enum-as-bit-set wrapper.
static const ObjectType OBJECT_LIGHTHOUSE
The nice lighthouse.
Definition object_type.h:19
uint16_t ObjectType
Types of objects.
Definition object_type.h:16
static const ObjectType OBJECT_STATUE
Statue in towns.
Definition object_type.h:20
PoolID< uint32_t, struct ObjectIDTag, 0xFF0000, 0xFFFFFFFF > ObjectID
Unique identifier for an object.
Definition object_type.h:30
static const ObjectType INVALID_OBJECT_TYPE
An invalid object.
Definition object_type.h:27
static const ObjectType OBJECT_HQ
HeadQuarter of a player.
Definition object_type.h:22
static const ObjectType NUM_OBJECTS
Number of supported objects overall.
Definition object_type.h:25
static const ObjectType OBJECT_TRANSMITTER
The large antenna.
Definition object_type.h:18
ObjectAnimationTrigger
Animation triggers for objects.
Definition object_type.h:36
@ Built
Triggered when the object is built (for all tiles at the same time).
Definition object_type.h:37
@ TileLoop
Triggered in the periodic tile loop.
Definition object_type.h:38
@ TileLoopNorth
Triggered every 256 ticks (for all tiles at the same time).
Definition object_type.h:39
static const ObjectType NUM_OBJECTS_PER_GRF
Number of supported objects per NewGRF.
Definition object_type.h:26
static const ObjectType NEW_OBJECT_OFFSET
Offset for new objects.
Definition object_type.h:24
static const ObjectType OBJECT_OWNED_LAND
Owned land 'flag'.
Definition object_type.h:21
Definition of Pool, structure used to access PoolItems, and PoolItem, base structure for Vehicle,...
An object that isn't use for transport, industries or houses.
An object, such as transmitter, on the map.
Definition object_base.h:23
Templated helper to make a PoolID a single POD value.
Definition pool_type.hpp:47