changeset 15666:1629cbfea0e4 draft

(svn r20331) -Doc: some more airport-related code
author yexo <yexo@openttd.org>
date Mon, 02 Aug 2010 23:09:38 +0000
parents c7563c611636
children 960ec264266c
files src/airport.h src/newgrf_airport.cpp src/newgrf_airport.h
diffstat 3 files changed, 16 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/airport.h
+++ b/src/airport.h
@@ -128,11 +128,12 @@
 
 	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;
@@ -140,11 +141,12 @@
 /** 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(
--- a/src/newgrf_airport.cpp
+++ b/src/newgrf_airport.cpp
@@ -56,6 +56,7 @@
 	return &AirportSpec::specs[type];
 }
 
+/** Check if this airport is available to build. */
 bool AirportSpec::IsAvailable() const
 {
 	if (!this->enabled) return false;
--- a/src/newgrf_airport.h
+++ b/src/newgrf_airport.h
@@ -20,9 +20,10 @@
 /* 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. */
@@ -48,8 +49,8 @@
 
 /** 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.
 };
 
 /**