1
0
Fork 0

(svn r22239) -Doc: Further engine doxyment additions.

release/1.2
alberth 2011-03-13 16:43:00 +00:00
parent 911dfa52bb
commit bb4d832146
3 changed files with 36 additions and 19 deletions

View File

@ -542,13 +542,21 @@ static void CheckRailIntroduction()
void ShowEnginePreviewWindow(EngineID engine); void ShowEnginePreviewWindow(EngineID engine);
/* Determine if an engine type is a wagon (and not a loco) */ /**
* Determine whether an engine type is a wagon (and not a loco).
* @param index %Engine getting queried.
* @return Whether the queried engine is a wagon.
*/
static bool IsWagon(EngineID index) static bool IsWagon(EngineID index)
{ {
const Engine *e = Engine::Get(index); const Engine *e = Engine::Get(index);
return e->type == VEH_TRAIN && e->u.rail.railveh_type == RAILVEH_WAGON; return e->type == VEH_TRAIN && e->u.rail.railveh_type == RAILVEH_WAGON;
} }
/**
* Update #reliability of engine \a e, (if needed) update the engine GUIs.
* @param e %Engine to update.
*/
static void CalcEngineReliability(Engine *e) static void CalcEngineReliability(Engine *e)
{ {
uint age = e->age; uint age = e->age;
@ -682,6 +690,11 @@ void StartupEngines()
InvalidateWindowClassesData(WC_BUILD_VEHICLE); InvalidateWindowClassesData(WC_BUILD_VEHICLE);
} }
/**
* Company \a company accepts engine \a eid for preview.
* @param eid Engine being accepted (is under preview).
* @param company Current company previewing the engine.
*/
static void AcceptEnginePreview(EngineID eid, CompanyID company) static void AcceptEnginePreview(EngineID eid, CompanyID company)
{ {
Engine *e = Engine::Get(eid); Engine *e = Engine::Get(eid);

View File

@ -23,19 +23,23 @@ typedef Pool<Engine, EngineID, 64, 64000> EnginePool;
extern EnginePool _engine_pool; extern EnginePool _engine_pool;
struct Engine : EnginePool::PoolItem<&_engine_pool> { struct Engine : EnginePool::PoolItem<&_engine_pool> {
char *name; ///< Custom name of engine char *name; ///< Custom name of engine.
Date intro_date; Date intro_date; ///< Date of introduction of the engine.
Date age; Date age;
uint16 reliability; uint16 reliability; ///< Current reliability of the engine.
uint16 reliability_spd_dec; uint16 reliability_spd_dec; ///< Speed of reliability decay between services (per day).
uint16 reliability_start, reliability_max, reliability_final; uint16 reliability_start; ///< Initial reliability of the engine.
uint16 duration_phase_1, duration_phase_2, duration_phase_3; uint16 reliability_max; ///< Maximal reliability of the engine.
byte flags; uint16 reliability_final; ///< Final reliability of the engine.
uint8 preview_company_rank; uint16 duration_phase_1; ///< First reliability phase in months, increasing reliability from #reliability_start to #reliability_max.
byte preview_wait; uint16 duration_phase_2; ///< Second reliability phase in months, keeping #reliability_max.
CompanyMask company_avail; uint16 duration_phase_3; ///< Third reliability phase on months, decaying to #reliability_final.
byte flags; ///< Flags of the engine. @see EngineFlags
uint8 preview_company_rank; ///< Rank of the company that is offered a preview. \c 0xFF means no company.
byte preview_wait; ///< Daily countdown timer for timeout of offering the engine to the #preview_company_rank company.
CompanyMask company_avail; ///< Bit for each company whether the engine is available for that company.
uint8 original_image_index; ///< Original vehicle image index, thus the image index of the overridden vehicle uint8 original_image_index; ///< Original vehicle image index, thus the image index of the overridden vehicle
VehicleType type; ///< type, ie VEH_ROAD, VEH_TRAIN, etc. VehicleType type; ///< %Vehicle type, ie #VEH_ROAD, #VEH_TRAIN, etc.
EngineInfo info; EngineInfo info;

View File

@ -90,12 +90,12 @@ struct AircraftVehicleInfo {
byte image_index; byte image_index;
byte cost_factor; byte cost_factor;
byte running_cost; byte running_cost;
byte subtype; byte subtype; ///< Type of aircraft. @see AircraftSubTypeBits
SoundID sfx; SoundID sfx;
byte acceleration; byte acceleration;
uint16 max_speed; ///< Maximum speed (1 unit = 8 mph = 12.8 km-ish/h) uint16 max_speed; ///< Maximum speed (1 unit = 8 mph = 12.8 km-ish/h)
byte mail_capacity; byte mail_capacity; ///< Mail capacity (bags).
uint16 passenger_capacity; uint16 passenger_capacity; ///< Passenger capacity (persons).
}; };
/** Information about a road vehicle. */ /** Information about a road vehicle. */
@ -119,16 +119,16 @@ struct RoadVehicleInfo {
* @see table/engines.h * @see table/engines.h
*/ */
struct EngineInfo { struct EngineInfo {
Date base_intro; Date base_intro; ///< Basic date of engine introduction (without random parts).
Year lifelength; ///< Lifetime of a single vehicle Year lifelength; ///< Lifetime of a single vehicle
Year base_life; ///< Basic duration of engine availability (without random parts) Year base_life; ///< Basic duration of engine availability (without random parts). \c 0xFF means infinite life.
byte decay_speed; byte decay_speed;
byte load_amount; byte load_amount;
byte climates; byte climates; ///< Climates supported by the engine.
CargoID cargo_type; CargoID cargo_type;
uint32 refit_mask; uint32 refit_mask;
byte refit_cost; byte refit_cost;
byte misc_flags; byte misc_flags; ///< Miscellaneous flags. @see EngineMiscFlags
byte callback_mask; ///< Bitmask of vehicle callbacks that have to be called byte callback_mask; ///< Bitmask of vehicle callbacks that have to be called
int8 retire_early; ///< Number of years early to retire vehicle int8 retire_early; ///< Number of years early to retire vehicle
StringID string_id; ///< Default name of engine StringID string_id; ///< Default name of engine