00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if !defined(__INCLUDE_TankMovementh_INCLUDE__)
00022 #define __INCLUDE_TankMovementh_INCLUDE__
00023
00024 #include <engine/ActionReferenced.h>
00025 #include <engine/ViewPoints.h>
00026 #include <common/FixedVector.h>
00027 #include <common/Counter.h>
00028 #include <weapons/Weapon.h>
00029 #include <list>
00030 #include <map>
00031
00032 class VirtualSoundSource;
00033 class WeaponMoveTank;
00034 class Tank;
00035 class TankMovement : public ActionReferenced
00036 {
00037 public:
00038 TankMovement(WeaponFireContext &weaponContext,
00039 WeaponMoveTank *weapon_,
00040 int positionX, int positionY);
00041 virtual ~TankMovement();
00042
00043 virtual void init();
00044 virtual void simulate(fixed frameTime, bool &remove);
00045 virtual std::string getActionDetails();
00046
00047 protected:
00048
00049 struct PositionEntry
00050 {
00051 PositionEntry(
00052 int fX, int fY,
00053 int sX, int sY,
00054 fixed newx, fixed newy, fixed newa, bool useF) :
00055 firstX(fX), firstY(fY),
00056 secondX(sX), secondY(sY),
00057 x(newx), y(newy), ang(newa),
00058 useFuel(useF)
00059 {}
00060
00061 int firstX, firstY;
00062 int secondX, secondY;
00063
00064 fixed x, y;
00065 fixed ang;
00066 bool useFuel;
00067 };
00068 WeaponMoveTank *weapon_;
00069 std::list<PositionEntry> expandedPositions_;
00070 fixed timePassed_;
00071 ViewPoints::ViewPoint *vPoint_;
00072 VirtualSoundSource *moveSoundSource_;
00073 Counter smokeCounter_;
00074
00075 WeaponFireContext weaponContext_;
00076 FixedVector startPosition_;
00077 int positionX_, positionY_;
00078 unsigned int stepCount_;
00079 bool remove_, moving_;
00080
00081 void moveTank(Tank *tank);
00082 void simulationMove(fixed frameTime);
00083
00084 };
00085
00086 #endif