Files
@ r7463:838c9d05e229
Branch filter:
Location: cpp/openttd-patchpack/source/src/roadveh.h - annotation
r7463:838c9d05e229
2.2 KiB
text/x-c
(svn r10964) -Update: WebTranslator2 update to 2007-08-22 22:57:00
croatian - 9 fixed, 13 changed by knovak (22)
italian - 10 fixed by lorenzodv (10)
japanese - 5 fixed by ickoonite (5)
polish - 10 fixed, 1 changed by meush (11)
slovak - 77 changed by lengyel (77)
spanish - 5 fixed by eusebio (5)
croatian - 9 fixed, 13 changed by knovak (22)
italian - 10 fixed by lorenzodv (10)
japanese - 5 fixed by ickoonite (5)
polish - 10 fixed, 1 changed by meush (11)
slovak - 77 changed by lengyel (77)
spanish - 5 fixed by eusebio (5)
r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r6417:89329fa8ac80 r6393:f9322fdf4c2c r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r7318:844268a38029 r5475:3f5cd13d1b63 r6259:e2dba394134b r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r7318:844268a38029 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r5786:21dd6ba13f91 r5475:3f5cd13d1b63 r5475:3f5cd13d1b63 r6552:7cade7798fcb r6552:7cade7798fcb r6552:7cade7798fcb r6552:7cade7798fcb r6552:7cade7798fcb r6552:7cade7798fcb r6552:7cade7798fcb r6552:7cade7798fcb r6552:7cade7798fcb r6552:7cade7798fcb r6552:7cade7798fcb r6552:7cade7798fcb r6552:7cade7798fcb r6552:7cade7798fcb r7412:e5f07529a093 r6552:7cade7798fcb r6563:67c636a8e3d4 r6553:04028e73a0f7 r6558:469828caa298 r6563:67c636a8e3d4 r6563:67c636a8e3d4 r6857:1e07df806ef1 r6857:1e07df806ef1 r7134:b101dff10042 r7135:3964060426dc r6552:7cade7798fcb r6552:7cade7798fcb r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r6857:1e07df806ef1 r5475:3f5cd13d1b63 | /* $Id$ */
/** @file src/roadveh.h Road vehicle states */
#ifndef ROADVEH_H
#define ROADVEH_H
#include "vehicle.h"
enum RoadVehicleSubType {
RVST_FRONT,
RVST_ARTIC_PART,
};
static inline bool IsRoadVehFront(const Vehicle *v)
{
assert(v->type == VEH_ROAD);
return v->subtype == RVST_FRONT;
}
static inline void SetRoadVehFront(Vehicle *v)
{
assert(v->type == VEH_ROAD);
v->subtype = RVST_FRONT;
}
static inline bool IsRoadVehArticPart(const Vehicle *v)
{
assert(v->type == VEH_ROAD);
return v->subtype == RVST_ARTIC_PART;
}
static inline void SetRoadVehArticPart(Vehicle *v)
{
assert(v->type == VEH_ROAD);
v->subtype = RVST_ARTIC_PART;
}
static inline bool RoadVehHasArticPart(const Vehicle *v)
{
assert(v->type == VEH_ROAD);
return v->next != NULL && IsRoadVehArticPart(v->next);
}
static inline bool IsRoadVehInDepot(const Vehicle *v)
{
assert(v->type == VEH_ROAD);
return v->u.road.state == 254;
}
static inline bool IsRoadVehInDepotStopped(const Vehicle *v)
{
return IsRoadVehInDepot(v) && v->vehstatus & VS_STOPPED;
}
void CcBuildRoadVeh(bool success, TileIndex tile, uint32 p1, uint32 p2);
void CcCloneRoadVeh(bool success, TileIndex tile, uint32 p1, uint32 p2);
/**
* This class 'wraps' Vehicle; you do not actually instantiate this class.
* You create a Vehicle using AllocateVehicle, so it is added to the pool
* and you reinitialize that to a Train using:
* v = new (v) RoadVehicle();
*
* As side-effect the vehicle type is set correctly.
*/
struct RoadVehicle : public Vehicle {
/** Initializes the Vehicle to a road vehicle */
RoadVehicle() { this->type = VEH_ROAD; }
/** We want to 'destruct' the right class. */
virtual ~RoadVehicle() { this->PreDestructor(); }
const char *GetTypeString() const { return "road vehicle"; }
void MarkDirty();
void UpdateDeltaXY(Direction direction);
ExpensesType GetExpenseType(bool income) const { return income ? EXPENSES_ROADVEH_INC : EXPENSES_ROADVEH_RUN; }
WindowClass GetVehicleListWindowClass() const { return WC_ROADVEH_LIST; }
bool IsPrimaryVehicle() const { return IsRoadVehFront(this); }
bool HasFront() const { return true; }
int GetImage(Direction direction) const;
void Tick();
};
byte GetRoadVehLength(const Vehicle *v);
void RoadVehUpdateCache(Vehicle *v);
#endif /* ROADVEH_H */
|