OpenTTD Source: src/object_type.h File Reference

OpenTTD Source 15.3

Typedefs | Enumerations | Variables
object_type.h File Reference

Types related to object tiles. More...

`#include "core/pool_type.hpp"`

Go to the source code of this file.

## Typedefs
typedef uint16_t | ObjectType
| Types of objects.
using | ObjectID = PoolID< uint32_t, struct ObjectIDTag, 0xFF0000, 0xFFFFFFFF >
| Unique identifier for an object.
using | ObjectAnimationTriggers = EnumBitSet< ObjectAnimationTrigger, uint16_t >

## Enumerations
enum class | ObjectAnimationTrigger : uint8_t { Built , TileLoop , TileLoopNorth }
| Animation triggers for objects. More...

## Variables
static const ObjectType | OBJECT_TRANSMITTER = 0
| The large antenna.
static const ObjectType | OBJECT_LIGHTHOUSE = 1
| The nice lighthouse.
static const ObjectType | OBJECT_STATUE = 2
| Statue in towns.
static const ObjectType | OBJECT_OWNED_LAND = 3
| Owned land 'flag'.
static const ObjectType | OBJECT_HQ = 4
| HeadQuarter of a player.
static const ObjectType | NEW_OBJECT_OFFSET = 5
| Offset for new objects.
static const ObjectType | NUM_OBJECTS = 64000
| Number of supported objects overall.
static const ObjectType | NUM_OBJECTS_PER_GRF = NUM_OBJECTS
| Number of supported objects per NewGRF.
static const ObjectType | INVALID_OBJECT_TYPE = 0xFFFF
| An invalid object.

## Detailed Description

Types related to object tiles.

Definition in file object_type.h.

## Typedef Documentation

## ◆ ObjectAnimationTriggers

using ObjectAnimationTriggers = EnumBitSet<ObjectAnimationTrigger, uint16_t>

Definition at line 41 of file object_type.h.

## ◆ ObjectID

using ObjectID = PoolID<uint32_t, struct ObjectIDTag, 0xFF0000, 0xFFFFFFFF>

Unique identifier for an object.

Definition at line 30 of file object_type.h.

## ◆ ObjectType

typedef uint16_t ObjectType

Types of objects.

Definition at line 16 of file object_type.h.

## Enumeration Type Documentation

## ◆ ObjectAnimationTrigger

enum class ObjectAnimationTrigger : uint8_t
| strong

Animation triggers for objects.

Enumerator
Built | Triggered when the object is built (for all tiles at the same time).
TileLoop | Triggered in the periodic tile loop.
TileLoopNorth | Triggered every 256 ticks (for all tiles at the same time).

Definition at line 36 of file object_type.h.

## Variable Documentation

## ◆ INVALID_OBJECT_TYPE

const ObjectType INVALID_OBJECT_TYPE = 0xFFFF
| static

An invalid object.

Definition at line 27 of file object_type.h.

## ◆ NEW_OBJECT_OFFSET

const ObjectType NEW_OBJECT_OFFSET = 5
| static

Offset for new objects.

Definition at line 24 of file object_type.h.

## ◆ NUM_OBJECTS

const ObjectType NUM_OBJECTS = 64000
| static

Number of supported objects overall.

Definition at line 25 of file object_type.h.

Referenced by Object::DecTypeCount(), ObjectSpec::Get(), GetCountAndDistanceOfClosestInstance(), Object::GetTypeCount(), and Object::IncTypeCount().

## ◆ NUM_OBJECTS_PER_GRF

const ObjectType NUM_OBJECTS_PER_GRF = NUM_OBJECTS
| static

Number of supported objects per NewGRF.

Definition at line 26 of file object_type.h.

Referenced by ObjectChangeInfo().

## ◆ OBJECT_HQ

const ObjectType OBJECT_HQ = 4
| static

HeadQuarter of a player.

Definition at line 22 of file object_type.h.

Referenced by AfterLoadGame(), CmdBuildObject(), and CompanyWindow::OnPlaceObject().

## ◆ OBJECT_LIGHTHOUSE

const ObjectType OBJECT_LIGHTHOUSE = 1
| static

The nice lighthouse.

Definition at line 19 of file object_type.h.

Referenced by CmdBuildObject(), ResetObjects(), and TryBuildLightHouse().

## ◆ OBJECT_OWNED_LAND

const ObjectType OBJECT_OWNED_LAND = 3
| static

Owned land 'flag'.

Definition at line 21 of file object_type.h.

Referenced by CmdBuildObject(), and TerraformToolbarWindow::OnPlaceMouseUp().

## ◆ OBJECT_STATUE

const ObjectType OBJECT_STATUE = 2
| static

Statue in towns.

Definition at line 20 of file object_type.h.

Referenced by AfterLoadGame(), CmdBuildObject(), CmdDeleteTown(), and TownActionBuildStatue().

## ◆ OBJECT_TRANSMITTER

const ObjectType OBJECT_TRANSMITTER = 0
| static

The large antenna.

Definition at line 18 of file object_type.h.

Referenced by CmdBuildObject(), ResetObjects(), ObjectOverrideManager::SetEntitySpec(), and TryBuildTransmitter().