Files
@ r10116:be292ddefbc7
Branch filter:
Location: cpp/openttd-patchpack/source/src/engine_base.h - annotation
r10116:be292ddefbc7
2.1 KiB
text/x-c
(svn r14300) -Update: WebTranslator2 update to 2008-09-12 17:41:59
brazilian_portuguese - 13 fixed by tucalipe (13)
catalan - 12 fixed by arnaullv (12)
danish - 9 fixed, 7 changed by ThomasA (16)
dutch - 1 changed by habell (1)
estonian - 5 fixed by kristjans (5)
galician - 98 fixed, 6 changed by Condex (104)
german - 7 fixed, 83 changed by sulai (69), dih (21)
korean - 12 fixed by leejaeuk5 (12)
romanian - 20 fixed by kneekoo (20)
slovenian - 5 fixed by Necrolyte (5)
brazilian_portuguese - 13 fixed by tucalipe (13)
catalan - 12 fixed by arnaullv (12)
danish - 9 fixed, 7 changed by ThomasA (16)
dutch - 1 changed by habell (1)
estonian - 5 fixed by kristjans (5)
galician - 98 fixed, 6 changed by Condex (104)
german - 7 fixed, 83 changed by sulai (69), dih (21)
korean - 12 fixed by leejaeuk5 (12)
romanian - 20 fixed by kneekoo (20)
slovenian - 5 fixed by Necrolyte (5)
r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9712:d1452202c62e r9070:e059c65164f3 r9709:77a56ba446dc r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 r9070:e059c65164f3 | /* $Id$ */
/** @file engine_base.h Base class for engines. */
#ifndef ENGINE_BASE_H
#define ENGINE_BASE_H
#include "engine_type.h"
#include "oldpool.h"
DECLARE_OLD_POOL(Engine, Engine, 6, 10000)
struct Engine : PoolItem<Engine, EngineID, &_Engine_pool> {
char *name; ///< Custom name of engine
Date intro_date;
Date age;
uint16 reliability;
uint16 reliability_spd_dec;
uint16 reliability_start, reliability_max, reliability_final;
uint16 duration_phase_1, duration_phase_2, duration_phase_3;
byte lifelength;
byte flags;
uint8 preview_player_rank;
byte preview_wait;
PlayerMask player_avail;
uint8 image_index; ///< Original vehicle image index
VehicleType type; ///< type, ie VEH_ROAD, VEH_TRAIN, etc.
EngineInfo info;
union {
RailVehicleInfo rail;
RoadVehicleInfo road;
ShipVehicleInfo ship;
AircraftVehicleInfo air;
} u;
/* NewGRF related data */
const struct GRFFile *grffile;
const struct SpriteGroup *group[NUM_CARGO + 2];
uint16 internal_id; ///< ID within the GRF file
uint16 overrides_count;
struct WagonOverride *overrides;
uint16 list_position;
Engine();
Engine(VehicleType type, EngineID base);
~Engine();
inline bool IsValid() const { return this->info.climates != 0; }
};
static inline bool IsEngineIndex(uint index)
{
return index < GetEnginePoolSize();
}
#define FOR_ALL_ENGINES_FROM(e, start) for (e = GetEngine(start); e != NULL; e = (e->index + 1U < GetEnginePoolSize()) ? GetEngine(e->index + 1U) : NULL) if (e->IsValid())
#define FOR_ALL_ENGINES(e) FOR_ALL_ENGINES_FROM(e, 0)
#define FOR_ALL_ENGINES_OF_TYPE(e, engine_type) FOR_ALL_ENGINES(e) if (e->type == engine_type)
static inline const EngineInfo *EngInfo(EngineID e)
{
return &GetEngine(e)->info;
}
static inline const RailVehicleInfo *RailVehInfo(EngineID e)
{
return &GetEngine(e)->u.rail;
}
static inline const RoadVehicleInfo *RoadVehInfo(EngineID e)
{
return &GetEngine(e)->u.road;
}
static inline const ShipVehicleInfo *ShipVehInfo(EngineID e)
{
return &GetEngine(e)->u.ship;
}
static inline const AircraftVehicleInfo *AircraftVehInfo(EngineID e)
{
return &GetEngine(e)->u.air;
}
#endif /* ENGINE_TYPE_H */
|