2006-06-05 13:43:41 +01:00
|
|
|
/* $Id$ */
|
|
|
|
|
2006-06-09 07:34:28 +01:00
|
|
|
#ifndef AIRCRAFT_H
|
|
|
|
#define AIRCRAFT_H
|
|
|
|
|
2006-06-05 13:43:41 +01:00
|
|
|
#include "station_map.h"
|
|
|
|
#include "vehicle.h"
|
|
|
|
|
2007-01-27 12:29:55 +00:00
|
|
|
typedef enum AircraftSubTypes {
|
|
|
|
AIR_HELICOPTER = 0,
|
|
|
|
AIR_AIRCRAFT = 2,
|
|
|
|
AIR_SHADOW = 4,
|
|
|
|
AIR_ROTOR = 6
|
|
|
|
} AircraftSubType;
|
|
|
|
|
|
|
|
|
|
|
|
/** Check if the aircraft type is a normal flying device; eg
|
|
|
|
* not a rotor or a shadow
|
|
|
|
* @param v vehicle to check
|
|
|
|
* @return Returns true if the aircraft is a helicopter/airplane and
|
|
|
|
* false if it is a shadow or a rotor) */
|
|
|
|
static inline bool IsNormalAircraft(const Vehicle *v)
|
|
|
|
{
|
|
|
|
assert(v->type == VEH_Aircraft);
|
|
|
|
/* To be fully correct the commented out functionality is the proper one,
|
|
|
|
* but since value can only be 0 or 2, it is sufficient to only check <= 2
|
|
|
|
* return (v->subtype == AIR_HELICOPTER) || (v->subtype == AIR_AIRCRAFT); */
|
|
|
|
return v->subtype <= AIR_AIRCRAFT;
|
|
|
|
}
|
|
|
|
|
2006-06-05 13:43:41 +01:00
|
|
|
|
|
|
|
static inline bool IsAircraftInHangar(const Vehicle* v)
|
|
|
|
{
|
|
|
|
assert(v->type == VEH_Aircraft);
|
|
|
|
return v->vehstatus & VS_HIDDEN && IsHangarTile(v->tile);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool IsAircraftInHangarStopped(const Vehicle* v)
|
|
|
|
{
|
|
|
|
return IsAircraftInHangar(v) && v->vehstatus & VS_STOPPED;
|
|
|
|
}
|
2006-06-09 07:34:28 +01:00
|
|
|
|
|
|
|
uint16 AircraftDefaultCargoCapacity(CargoID cid, EngineID engine_type);
|
|
|
|
|
2007-01-21 22:57:52 +00:00
|
|
|
void CcBuildAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2);
|
2006-09-27 16:40:55 +01:00
|
|
|
void CcCloneAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2);
|
2006-10-05 03:26:27 +01:00
|
|
|
void HandleAircraftEnterHangar(Vehicle *v);
|
2007-02-10 13:37:32 +00:00
|
|
|
void GetAircraftSpriteSize(EngineID engine, uint &width, uint &height);
|
2006-09-27 16:40:55 +01:00
|
|
|
|
2006-06-09 07:34:28 +01:00
|
|
|
#endif /* AIRCRAFT_H */
|