|
|
/*
|
|
|
* This file is part of OpenTTD.
|
|
|
* 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.
|
|
|
* 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.
|
|
|
* 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/>.
|
|
|
*/
|
|
|
|
|
|
/** @file tile_cmd.h Generic 'commands' that can be performed on all tiles. */
|
|
|
|
|
|
#ifndef TILE_CMD_H
|
|
|
#define TILE_CMD_H
|
|
|
|
|
|
#include "command_type.h"
|
|
|
#include "vehicle_type.h"
|
|
|
#include "cargo_type.h"
|
|
|
#include "track_type.h"
|
|
|
#include "tile_map.h"
|
|
|
#include "timer/timer_game_calendar.h"
|
|
|
|
|
|
/** The returned bits of VehicleEnterTile. */
|
|
|
enum VehicleEnterTileStatus {
|
|
|
VETS_ENTERED_STATION = 1, ///< The vehicle entered a station
|
|
|
VETS_ENTERED_WORMHOLE = 2, ///< The vehicle either entered a bridge, tunnel or depot tile (this includes the last tile of the bridge/tunnel)
|
|
|
VETS_CANNOT_ENTER = 3, ///< The vehicle cannot enter the tile
|
|
|
|
|
|
/**
|
|
|
* Shift the VehicleEnterTileStatus this many bits
|
|
|
* to the right to get the station ID when
|
|
|
* VETS_ENTERED_STATION is set
|
|
|
*/
|
|
|
VETS_STATION_ID_OFFSET = 8,
|
|
|
VETS_STATION_MASK = 0xFFFF << VETS_STATION_ID_OFFSET,
|
|
|
|
|
|
/** Bit sets of the above specified bits */
|
|
|
VETSB_CONTINUE = 0, ///< The vehicle can continue normally
|
|
|
VETSB_ENTERED_STATION = 1 << VETS_ENTERED_STATION, ///< The vehicle entered a station
|
|
|
VETSB_ENTERED_WORMHOLE = 1 << VETS_ENTERED_WORMHOLE, ///< The vehicle either entered a bridge, tunnel or depot tile (this includes the last tile of the bridge/tunnel)
|
|
|
VETSB_CANNOT_ENTER = 1 << VETS_CANNOT_ENTER, ///< The vehicle cannot enter the tile
|
|
|
};
|
|
|
DECLARE_ENUM_AS_BIT_SET(VehicleEnterTileStatus)
|
|
|
|
|
|
/** Tile information, used while rendering the tile */
|
|
|
struct TileInfo {
|
|
|
int x; ///< X position of the tile in unit coordinates
|
|
|
int y; ///< Y position of the tile in unit coordinates
|
|
|
Slope tileh; ///< Slope of the tile
|
|
|
TileIndex tile; ///< Tile index
|
|
|
int z; ///< Height
|
|
|
};
|
|
|
|
|
|
/** Tile description for the 'land area information' tool */
|
|
|
struct TileDesc {
|
|
|
StringID str; ///< Description of the tile
|
|
|
Owner owner[4]; ///< Name of the owner(s)
|
|
|
StringID owner_type[4]; ///< Type of each owner
|
|
|
Date build_date; ///< Date of construction of tile contents
|
|
|
TimerGameCalendar::Date build_date; ///< Date of construction of tile contents
|
|
|
StringID station_class; ///< Class of station
|
|
|
StringID station_name; ///< Type of station within the class
|
|
|
StringID airport_class; ///< Name of the airport class
|
|
|
StringID airport_name; ///< Name of the airport
|
|
|
StringID airport_tile_name; ///< Name of the airport tile
|
|
|
const char *grf; ///< newGRF used for the tile contents
|
|
|
uint64 dparam[2]; ///< Parameters of the \a str string
|
|
|
StringID railtype; ///< Type of rail on the tile.
|
|
|
uint16 rail_speed; ///< Speed limit of rail (bridges and track)
|
|
|
StringID roadtype; ///< Type of road on the tile.
|
|
|
uint16 road_speed; ///< Speed limit of road (bridges and track)
|
|
|
StringID tramtype; ///< Type of tram on the tile.
|
|
|
uint16 tram_speed; ///< Speed limit of tram (bridges and track)
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* Tile callback function signature for drawing a tile and its contents to the screen
|
|
|
* @param ti Information about the tile to draw
|
|
|
*/
|
|
|
typedef void DrawTileProc(TileInfo *ti);
|
|
|
|
|
|
/**
|
|
|
* Tile callback function signature for obtaining the world \c Z coordinate of a given
|
|
|
* point of a tile.
|