#include "core/bitmath_func.hpp"
#include "tile_map.h"
Go to the source code of this file.
Enumerations | |
enum | { HQ_NUM_TILE = 4, HQ_NUM_SIZE = 5 } |
enum | UnmovableType { UNMOVABLE_TRANSMITTER = 0, UNMOVABLE_LIGHTHOUSE = 1, UNMOVABLE_STATUE = 2, UNMOVABLE_OWNED_LAND = 3, UNMOVABLE_HQ_NORTH = 0x80, UNMOVABLE_HQ_WEST = 0x81, UNMOVABLE_HQ_EAST = 0x82, UNMOVABLE_HQ_SOUTH = 0x83, UNMOVABLE_HQ_END = UNMOVABLE_HQ_NORTH + HQ_NUM_SIZE * HQ_NUM_TILE } |
Types of unmovable structure. More... | |
Functions | |
static UnmovableType | GetUnmovableType (TileIndex t) |
Gets the UnmovableType of the given unmovable tile. | |
static bool | IsTransmitterTile (TileIndex t) |
Does the given tile have a transmitter? | |
static bool | IsOwnedLand (TileIndex t) |
Is this unmovable 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 unmovable tile a HQ tile? | |
static bool | IsStatue (TileIndex t) |
Is this unmovable tile a statue? | |
static bool | IsStatueTile (TileIndex t) |
Is the given tile a statue? | |
static TownID | GetStatueTownID (TileIndex t) |
Get the town of the given statue tile. | |
static byte | GetCompanyHQSize (TileIndex t) |
Get the 'stage' of the HQ. | |
static byte | GetCompanyHQSection (TileIndex t) |
Get the 'section' (including stage) of the HQ. | |
static void | EnlargeCompanyHQ (TileIndex t, byte size) |
Enlarge the given HQ to the given size. | |
static void | MakeUnmovable (TileIndex t, UnmovableType u, Owner o) |
Make an Unmovable tile. | |
static void | MakeTransmitter (TileIndex t) |
Make a transmitter tile. | |
static void | MakeLighthouse (TileIndex t) |
Make a lighthouse tile. | |
static void | MakeStatue (TileIndex t, Owner o, TownID town_id) |
Make a statue tile. | |
static void | MakeOwnedLand (TileIndex t, Owner o) |
Make an 'owned land' tile. | |
static void | MakeCompanyHQ (TileIndex t, Owner o) |
Make an HQ with the give tile as it's northern tile. |
Definition in file unmovable_map.h.
anonymous enum |
Definition at line 11 of file unmovable_map.h.
enum UnmovableType |
Types of unmovable structure.
Definition at line 17 of file unmovable_map.h.
static void EnlargeCompanyHQ | ( | TileIndex | t, | |
byte | size | |||
) | [inline, static] |
Enlarge the given HQ to the given size.
If the new size is larger than the current size, nothing happens.
t | the tile of the HQ. | |
size | the new size of the HQ. |
Definition at line 154 of file unmovable_map.h.
References _m, GB(), GetCompanyHQSection(), Tile::m5, TileDiffXY(), UNMOVABLE_HQ_EAST, UNMOVABLE_HQ_NORTH, UNMOVABLE_HQ_SOUTH, and UNMOVABLE_HQ_WEST.
static byte GetCompanyHQSection | ( | TileIndex | t | ) | [inline, static] |
Get the 'section' (including stage) of the HQ.
t | a tile of the HQ. |
Definition at line 141 of file unmovable_map.h.
References _m, GB(), IsCompanyHQ(), IsTileType(), and MP_UNMOVABLE.
Referenced by EnlargeCompanyHQ().
static byte GetCompanyHQSize | ( | TileIndex | t | ) | [inline, static] |
Get the 'stage' of the HQ.
t | a tile of the HQ. |
Definition at line 129 of file unmovable_map.h.
References _m, GB(), IsCompanyHQ(), IsTileType(), and MP_UNMOVABLE.
static TownID GetStatueTownID | ( | TileIndex | t | ) | [inline, static] |
Get the town of the given statue tile.
t | the tile of the statue. |
Definition at line 117 of file unmovable_map.h.
References _m, IsStatueTile(), and Tile::m2.
static UnmovableType GetUnmovableType | ( | TileIndex | t | ) | [inline, static] |
Gets the UnmovableType of the given unmovable tile.
t | the tile to get the type from. |
Definition at line 39 of file unmovable_map.h.
References _m, IsTileType(), Tile::m5, and MP_UNMOVABLE.
Referenced by IsCompanyHQ(), IsOwnedLand(), IsStatue(), and IsTransmitterTile().
static bool IsCompanyHQ | ( | TileIndex | t | ) | [inline, static] |
Is this unmovable tile a HQ tile?
t | the tile to inspect. |
Definition at line 83 of file unmovable_map.h.
References GetUnmovableType(), IsInsideMM(), IsTileType(), MP_UNMOVABLE, UNMOVABLE_HQ_END, and UNMOVABLE_HQ_NORTH.
Referenced by GetCompanyHQSection(), and GetCompanyHQSize().
static bool IsOwnedLand | ( | TileIndex | t | ) | [inline, static] |
Is this unmovable tile an 'owned land' tile?
t | the tile to inspect. |
Definition at line 61 of file unmovable_map.h.
References GetUnmovableType(), IsTileType(), MP_UNMOVABLE, and UNMOVABLE_OWNED_LAND.
Referenced by CmdBuildBridge(), and IsOwnedLandTile().
static bool IsOwnedLandTile | ( | TileIndex | t | ) | [inline, static] |
Is the given tile (pre-)owned by someone (the little flags)?
t | the tile to inspect. |
Definition at line 72 of file unmovable_map.h.
References IsOwnedLand(), IsTileType(), and MP_UNMOVABLE.
Referenced by CmdPurchaseLandArea(), and CmdSellLandArea().
static bool IsStatue | ( | TileIndex | t | ) | [inline, static] |
Is this unmovable tile a statue?
t | the tile to inspect. |
Definition at line 95 of file unmovable_map.h.
References GetUnmovableType(), IsTileType(), MP_UNMOVABLE, and UNMOVABLE_STATUE.
Referenced by IsStatueTile().
static bool IsStatueTile | ( | TileIndex | t | ) | [inline, static] |
Is the given tile a statue?
t | the tile to inspect. |
Definition at line 106 of file unmovable_map.h.
References IsStatue(), IsTileType(), and MP_UNMOVABLE.
Referenced by GetStatueTownID().
static bool IsTransmitterTile | ( | TileIndex | t | ) | [inline, static] |
Does the given tile have a transmitter?
t | the tile to inspect. |
Definition at line 50 of file unmovable_map.h.
References GetUnmovableType(), IsTileType(), MP_UNMOVABLE, and UNMOVABLE_TRANSMITTER.
Make an HQ with the give tile as it's northern tile.
t | the tile to make the northern tile of a HQ. | |
o | the owner of the HQ. |
Definition at line 231 of file unmovable_map.h.
References MakeUnmovable(), TileDiffXY(), UNMOVABLE_HQ_EAST, UNMOVABLE_HQ_NORTH, UNMOVABLE_HQ_SOUTH, and UNMOVABLE_HQ_WEST.
Referenced by CmdBuildCompanyHQ().
static void MakeLighthouse | ( | TileIndex | t | ) | [inline, static] |
Make a lighthouse tile.
t | the tile to make a transmitter. |
Definition at line 199 of file unmovable_map.h.
References MakeUnmovable(), OWNER_NONE, and UNMOVABLE_LIGHTHOUSE.
Make an 'owned land' tile.
t | the tile to make an 'owned land' tile. | |
o | the owner of the land. |
Definition at line 221 of file unmovable_map.h.
References MakeUnmovable(), and UNMOVABLE_OWNED_LAND.
Referenced by CmdPurchaseLandArea().
Make a statue tile.
t | the tile to make a statue. | |
o | the owner of the statue. | |
town_id | the town the statue was built in. |
Definition at line 210 of file unmovable_map.h.
References _m, Tile::m2, MakeUnmovable(), and UNMOVABLE_STATUE.
static void MakeTransmitter | ( | TileIndex | t | ) | [inline, static] |
Make a transmitter tile.
t | the tile to make a transmitter. |
Definition at line 190 of file unmovable_map.h.
References MakeUnmovable(), OWNER_NONE, and UNMOVABLE_TRANSMITTER.
static void MakeUnmovable | ( | TileIndex | t, | |
UnmovableType | u, | |||
Owner | o | |||
) | [inline, static] |
Make an Unmovable tile.
t | the tile to make unmovable. | |
u | the unmovable type of the tile. | |
o | the new owner of the tile. |
Definition at line 175 of file unmovable_map.h.
References _m, Tile::m2, Tile::m3, Tile::m4, Tile::m5, MP_UNMOVABLE, SetTileOwner(), and SetTileType().
Referenced by MakeCompanyHQ(), MakeLighthouse(), MakeOwnedLand(), MakeStatue(), and MakeTransmitter().