# object_map.h File Reference

Map accessors for object tiles. More...

`#include "water_map.h"`
`#include "object_type.h"`

Go to the source code of this file.

## Functions
static ObjectType | GetObjectType (TileIndex t)
| Gets the ObjectType of the given object tile.
static ObjectID | GetObjectIndex (TileIndex t)
| Get the index of which object this tile is attached to.
static bool | IsTransmitterTile (TileIndex t)
| Does the given tile have a transmitter?
static bool | IsOwnedLand (TileIndex t)
| Is this object tile an 'owned land' tile?
static bool | IsOwnedLandTile (TileIndex t)
| Is the given tile (pre-)owned by someone (the little flags)?
static bool | IsCompanyHQ (TileIndex t)
| Is this object tile a HQ tile?
static bool | IsStatue (TileIndex t)
| Is this object tile a statue?
static bool | IsStatueTile (TileIndex t)
| Is the given tile a statue?
static byte | GetObjectRandomBits (TileIndex t)
| Get the random bits of this tile.
static void | MakeObject (TileIndex t, ObjectType u, Owner o, ObjectID index, WaterClass wc, byte random)
| Make an Object tile.

## Detailed Description

Map accessors for object tiles.

Definition in file object_map.h.

## Function Documentation

static ObjectID GetObjectIndex | ( | TileIndex | t | ) | `[inline, static]`

Get the index of which object this tile is attached to.

Parameters:

  | t | the tile

Precondition:
  IsTileType(t, MP_OBJECT)

Returns:
  The ObjectID of the object.

Definition at line 36 of file object_map.h.

References _m, IsTileType(), Tile::m2, and MP_OBJECT.

Referenced by Object::GetByTile(), and GetNearbyObjectTileInformation().

static byte GetObjectRandomBits | ( | TileIndex | t | ) | `[inline, static]`

Get the random bits of this tile.

Parameters:

  | t | The tile to get the bits for.

Precondition:
  IsTileType(t, MP_OBJECT)

Returns:
  The random bits.

Definition at line 114 of file object_map.h.

References _m, IsTileType(), Tile::m3, and MP_OBJECT.

Referenced by ObjectGetVariable().

static ObjectType GetObjectType | ( | TileIndex | t | ) | `[inline, static]`

Gets the ObjectType of the given object tile.

Parameters:

  | t | the tile to get the type from.

Precondition:
  IsTileType(t, MP_OBJECT)

Returns:
  the type.

Definition at line 24 of file object_map.h.

References _m, IsTileType(), Tile::m5, and MP_OBJECT.

Referenced by AfterLoadGame(), CmdDeleteTown(), ObjectSpec::GetByTile(), GetClosestObject(), IsOwnedLand(), IsStatue(), IsTransmitterTile(), and ReallyClearObjectTile().

static bool IsCompanyHQ | ( | TileIndex | t | ) | `[inline, static]`

Is this object tile a HQ tile?

Parameters:

  | t | the tile to inspect.

Precondition:
  IsTileType(t, MP_OBJECT)

Returns:
  true if and only if the tile is a HQ tile.

Definition at line 80 of file object_map.h.

References _m, IsTileType(), Tile::m5, MP_OBJECT, and OBJECT_HQ.

static bool IsOwnedLand | ( | TileIndex | t | ) | `[inline, static]`

Is this object tile an 'owned land' tile?

Parameters:

  | t | the tile to inspect.

Precondition:
  IsTileType(t, MP_OBJECT)

Returns:
  true if and only if the tile is an 'owned land' tile.

Definition at line 58 of file object_map.h.

References GetObjectType(), IsTileType(), MP_OBJECT, and OBJECT_OWNED_LAND.

Referenced by CmdBuildObject(), and IsOwnedLandTile().

static bool IsOwnedLandTile | ( | TileIndex | t | ) | `[inline, static]`

Is the given tile (pre-)owned by someone (the little flags)?

Parameters:

  | t | the tile to inspect.

Returns:
  true if and only if the tile is an 'owned land' tile.

Definition at line 69 of file object_map.h.

References IsOwnedLand(), IsTileType(), and MP_OBJECT.

static bool IsStatue | ( | TileIndex | t | ) | `[inline, static]`

Is this object tile a statue?

Parameters:

  | t | the tile to inspect.

Precondition:
  IsTileType(t, MP_OBJECT)

Returns:
  true if and only if the tile is a statue.

Definition at line 92 of file object_map.h.

References GetObjectType(), IsTileType(), MP_OBJECT, and OBJECT_STATUE.

Referenced by IsStatueTile().

static bool IsStatueTile | ( | TileIndex | t | ) | `[inline, static]`

Is the given tile a statue?

Parameters:

  | t | the tile to inspect.

Returns:
  true if and only if the tile is a statue.

Definition at line 103 of file object_map.h.

References IsStatue(), IsTileType(), and MP_OBJECT.

Referenced by AfterLoadGame().

static bool IsTransmitterTile | ( | TileIndex | t | ) | `[inline, static]`

Does the given tile have a transmitter?

Parameters:

  | t | the tile to inspect.

Returns:
  true if and only if the tile has a transmitter.

Definition at line 47 of file object_map.h.

References GetObjectType(), IsTileType(), MP_OBJECT, and OBJECT_TRANSMITTER.

Referenced by HasTransmitter().

static void MakeObject | ( | TileIndex | t,
|  | ObjectType | u,
|  | Owner | o,
|  | ObjectID | index,
|  | WaterClass | wc,
|  | byte | random |
| ) |  |  | `[inline, static]`

Make an Object tile.

Note:
  do not use this function directly. Use one of the other Make* functions.

Parameters:

  | t | The tile to make and object tile.
  | u | The object type of the tile.
  | o | The new owner of the tile.
  | index | Index to the object.
  | wc | Water class for this obect.
  | random | Random data to store on the tile

Definition at line 131 of file object_map.h.

References _m, _me, Tile::m2, Tile::m3, Tile::m4, Tile::m5, TileExtended::m7, MP_OBJECT, SB(), SetTileOwner(), SetTileType(), and SetWaterClass().

Referenced by BuildObject().