From b139756e2ba70431364b21a5b49950fc991dbdef Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 20 Apr 2008 11:12:07 +0000 Subject: (svn r12804) -Codechange: move the effect vehicle handling out of vehicle.cpp --- src/effectvehicle_base.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/effectvehicle_base.h (limited to 'src/effectvehicle_base.h') diff --git a/src/effectvehicle_base.h b/src/effectvehicle_base.h new file mode 100644 index 000000000..92742cf90 --- /dev/null +++ b/src/effectvehicle_base.h @@ -0,0 +1,37 @@ +/* $Id$ */ + +/** @file effectvehicle_base.h Base class for all effect vehicles. */ + +#ifndef EFFECTVEHICLE_BASE_H +#define EFFECTVEHICLE_BASE_H + +#include "vehicle_base.h" + +/** + * 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) Train(); + * + * As side-effect the vehicle type is set correctly. + * + * A special vehicle is one of the following: + * - smoke + * - electric sparks for trains + * - explosions + * - bulldozer (road works) + * - bubbles (industry) + */ +struct EffectVehicle : public Vehicle { + /** Initializes the Vehicle to a special vehicle */ + EffectVehicle() { this->type = VEH_EFFECT; } + + /** We want to 'destruct' the right class. */ + virtual ~EffectVehicle() {} + + const char *GetTypeString() const { return "special vehicle"; } + void UpdateDeltaXY(Direction direction); + void Tick(); +}; + +#endif /* EFFECTVEHICLE_BASE_H */ -- cgit v1.2.3-54-g00ecf