(svn r12346) -Fix [FS#1748, FS#1825](r9874, r11872): Remove duplicated and inconsistent code wrt. autoreplace with rules in both vehicles' group and ALL_GROUP.
/* $Id$ *//** @file src/roadveh.h Road vehicle states */#ifndef ROADVEH_H#define ROADVEH_H#include"vehicle_base.h"#include"engine.h"#include"economy_func.h"enumRoadVehicleSubType{RVST_FRONT,RVST_ARTIC_PART,};staticinlineboolIsRoadVehFront(constVehicle*v){assert(v->type==VEH_ROAD);returnv->subtype==RVST_FRONT;}staticinlinevoidSetRoadVehFront(Vehicle*v){assert(v->type==VEH_ROAD);v->subtype=RVST_FRONT;}staticinlineboolIsRoadVehArticPart(constVehicle*v){assert(v->type==VEH_ROAD);returnv->subtype==RVST_ARTIC_PART;}staticinlinevoidSetRoadVehArticPart(Vehicle*v){assert(v->type==VEH_ROAD);v->subtype=RVST_ARTIC_PART;}staticinlineboolRoadVehHasArticPart(constVehicle*v){assert(v->type==VEH_ROAD);returnv->Next()!=NULL&&IsRoadVehArticPart(v->Next());}voidCcBuildRoadVeh(boolsuccess,TileIndextile,uint32p1,uint32p2);/** * 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. */structRoadVehicle:publicVehicle{/** Initializes the Vehicle to a road vehicle */RoadVehicle(){this->type=VEH_ROAD;}/** We want to 'destruct' the right class. */virtual~RoadVehicle(){this->PreDestructor();}constchar*GetTypeString()const{return"road vehicle";}voidMarkDirty();voidUpdateDeltaXY(Directiondirection);ExpensesTypeGetExpenseType(boolincome)const{returnincome?EXPENSES_ROADVEH_INC:EXPENSES_ROADVEH_RUN;}WindowClassGetVehicleListWindowClass()const{returnWC_ROADVEH_LIST;}boolIsPrimaryVehicle()const{returnIsRoadVehFront(this);}intGetImage(Directiondirection)const;intGetDisplaySpeed()const{returnthis->cur_speed*10/32;}intGetDisplayMaxSpeed()const{returnthis->max_speed*10/32;}MoneyGetRunningCost()const{returnRoadVehInfo(this->engine_type)->running_cost*GetPriceByIndex(RoadVehInfo(this->engine_type)->running_cost_class);}boolIsInDepot()const{returnthis->u.road.state==RVSB_IN_DEPOT;}voidTick();voidOnNewDay();};byteGetRoadVehLength(constVehicle*v);voidRoadVehUpdateCache(Vehicle*v);#endif /* ROADVEH_H */