summaryrefslogtreecommitdiff
path: root/src/aircraft.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/aircraft.h')
-rw-r--r--src/aircraft.h37
1 files changed, 31 insertions, 6 deletions
diff --git a/src/aircraft.h b/src/aircraft.h
index 0e0cd76ad..fe2e7494c 100644
--- a/src/aircraft.h
+++ b/src/aircraft.h
@@ -8,11 +8,12 @@
#include "station_map.h"
#include "vehicle.h"
+/* An aircraft can be one ot those types */
enum AircraftSubType {
- AIR_HELICOPTER = 0,
- AIR_AIRCRAFT = 2,
- AIR_SHADOW = 4,
- AIR_ROTOR = 6
+ AIR_HELICOPTER = 0, ///< an helicopter
+ AIR_AIRCRAFT = 2, ///< an airplace
+ AIR_SHADOW = 4, ///< shadow of the aircraft
+ AIR_ROTOR = 6 ///< rotor of an helicopter
};
@@ -30,13 +31,20 @@ static inline bool IsNormalAircraft(const Vehicle *v)
return v->subtype <= AIR_AIRCRAFT;
}
-
+/** Check if this aircraft is in a hangar
+ * @param v vehicle to check
+ * @return true if in hangar
+ */
static inline bool IsAircraftInHangar(const Vehicle* v)
{
assert(v->type == VEH_AIRCRAFT);
return v->vehstatus & VS_HIDDEN && IsHangarTile(v->tile);
}
+/** Check if this aircraft is in a hangar and stopped
+ * @param v vehicle to check
+ * @return true if in hangar and stopped
+ */
static inline bool IsAircraftInHangarStopped(const Vehicle* v)
{
return IsAircraftInHangar(v) && v->vehstatus & VS_STOPPED;
@@ -56,11 +64,28 @@ static inline bool IsAircraftBuildableAtStation(EngineID engine, TileIndex tile)
return (apc->flags & (avi->subtype & AIR_CTOL ? AirportFTAClass::AIRPLANES : AirportFTAClass::HELICOPTERS)) != 0;
}
-uint16 AircraftDefaultCargoCapacity(CargoID cid, const AircraftVehicleInfo*);
+/**
+ * Calculates cargo capacity based on an aircraft's passenger
+ * and mail capacities.
+ * @param cid Which cargo type to calculate a capacity for.
+ * @param avi Which engine to find a cargo capacity for.
+ * @return New cargo capacity value.
+ */
+uint16 AircraftDefaultCargoCapacity(CargoID cid, const AircraftVehicleInfo avi*);
void CcBuildAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2);
void CcCloneAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2);
+
+/** Handle Aircraft specific tasks when a an Aircraft enters a hangar
+ * @param *v Vehicle that enters the hangar
+ */
void HandleAircraftEnterHangar(Vehicle *v);
+
+/** Get the size of the sprite of an aircraft sprite heading west (used for lists)
+ * @param engine The engine to get the sprite from
+ * @param width The width of the sprite
+ * @param height The height of the sprite
+ */
void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height);
void UpdateAirplanesOnNewStation(const Station *st);