Changeset - r15656:e21174b90f22
[Not reviewed]
master
0 3 0
yexo - 14 years ago 2010-08-02 23:09:38
yexo@openttd.org
(svn r20331) -Doc: some more airport-related code
3 files changed with 16 insertions and 12 deletions:
0 comments (0 inline, 0 general)
src/airport.h
Show inline comments
 
@@ -125,29 +125,31 @@ static const uint64
 
	HELIPAD_GROUP_block      = 1ULL << 13,   ///< note re-uses AIRPORT_ENTRANCE
 
	OUT_WAY_block2           = 1ULL << 31,
 
	/* end of new blocks */
 

	
 
	NOTHING_block            = 1ULL << 30;
 

	
 
/** A single location on an airport where aircraft can move to. */
 
struct AirportMovingData {
 
	int16 x;
 
	int16 y;
 
	uint16 flag;
 
	DirectionByte direction;
 
	int16 x;                 ///< x-coordinate of this position
 
	int16 y;                 ///< y-coordinate of this position
 
	uint16 flag;             ///< special flags when moving towards this position
 
	DirectionByte direction; ///< Direction to turn the aircraft after reaching this position.
 
};
 

	
 
struct AirportFTAbuildup;
 

	
 
/** Finite sTate mAchine --> FTA */
 
struct AirportFTAClass {
 
public:
 
	/** Bitmask of airport flags. */
 
	enum Flags {
 
		AIRPLANES   = 0x1,
 
		HELICOPTERS = 0x2,
 
		ALL         = AIRPLANES | HELICOPTERS,
 
		SHORT_STRIP = 0x4
 
		AIRPLANES   = 0x1,                     ///< Can planes land on this airport type?
 
		HELICOPTERS = 0x2,                     ///< Can helicopters land on this airport type?
 
		ALL         = AIRPLANES | HELICOPTERS, ///< Mask to check for both planes and helicopters.
 
		SHORT_STRIP = 0x4                      ///< This airport has a short landing strip, dangerous for fast aircraft.
 
	};
 

	
 
	AirportFTAClass(
 
		const AirportMovingData *moving_data,
 
		const byte *terminals,
 
		const byte *helipads,
src/newgrf_airport.cpp
Show inline comments
 
@@ -53,12 +53,13 @@ AirportSpec AirportSpec::specs[NUM_AIRPO
 
/* static */ AirportSpec *AirportSpec::GetWithoutOverride(byte type)
 
{
 
	assert(type < lengthof(AirportSpec::specs));
 
	return &AirportSpec::specs[type];
 
}
 

	
 
/** Check if this airport is available to build. */
 
bool AirportSpec::IsAvailable() const
 
{
 
	if (!this->enabled) return false;
 
	if (_cur_year < this->min_year) return false;
 
	if (_settings_game.station.never_expire_airports) return true;
 
	return _cur_year <= this->max_year;
src/newgrf_airport.h
Show inline comments
 
@@ -17,15 +17,16 @@
 
#include "strings_type.h"
 
#include "newgrf_commons.h"
 

	
 
/* Copy from station_map.h */
 
typedef byte StationGfx;
 

	
 
/** Tile-offset / AirportTileID pair. */
 
struct AirportTileTable {
 
	TileIndexDiffC ti;
 
	StationGfx gfx;
 
	TileIndexDiffC ti; ///< Tile offset from  the top-most airport tile.
 
	StationGfx gfx;    ///< AirportTile to use for this tile.
 
};
 

	
 
/** List of default airport classes. */
 
enum AirportClassID {
 
	APC_BEGIN     = 0,  ///< Lowest valid airport class id
 
	APC_SMALL     = 0,  ///< id for small airports class
 
@@ -45,14 +46,14 @@ enum TTDPAirportType {
 
	ATP_TTDP_HELIPORT, ///< Same as AT_HELIPORT
 
	ATP_TTDP_OILRIG,   ///< Same as AT_OILRIG
 
};
 

	
 
/** A list of all hangar tiles in an airport */
 
struct HangarTileTable {
 
	TileIndexDiffC ti;
 
	byte hangar_num;
 
	TileIndexDiffC ti; ///< Tile offset from the top-most airport tile.
 
	byte hangar_num;   ///< The hanger to which this tile belongs.
 
};
 

	
 
/**
 
 * Defines the data structure for an airport.
 
 */
 
struct AirportSpec {
0 comments (0 inline, 0 general)