00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if defined(karteneditor)
00022 #error the mapeditor should not need to use reactionfire.h !
00023 #endif
00024
00025
00026 #ifndef reactionfireH
00027 #define reactionfireH
00028
00029 #include "typen.h"
00030 #include "astar2.h"
00031 #include "actions/context.h"
00032
00033 class MapDisplayInterface;
00034
00035
00036 class treactionfire {
00037 public:
00038 virtual int checkfield ( const MapCoordinate3D& pos, Vehicle* &eht, const Context& context ) = 0;
00039 virtual void init ( Vehicle* eht, const AStar3D::Path& fieldlist ) = 0;
00040 virtual int finalCheck ( int currentPlayer, const Context& context ) = 0;
00041 virtual ~treactionfire() {};
00042 };
00043
00044
00045 class tsearchreactionfireingunits : public treactionfire {
00046 private:
00047 void initLimits();
00048 void findOffensiveUnits( Vehicle* vehicle, int height, int x1, int y1, int x2, int y2 );
00049
00050 GameMap* gamemap;
00051 protected:
00052 int attack( Vehicle* attacker, Vehicle* target, const Context& context );
00053
00054 static int maxshootdist[8];
00055 void addunit ( Vehicle* vehicle );
00056 void removeunit ( Vehicle* vehicle );
00057
00058 typedef map<const Vehicle*,int> VisibleUnits;
00059 VisibleUnits visibleUnits;
00060
00061 public:
00062
00063 tsearchreactionfireingunits( GameMap* gamemap );
00064 void init ( Vehicle* eht, const AStar3D::Path& fieldlist );
00065 void init ( Vehicle* eht, const MapCoordinate3D& pos );
00066 int checkfield ( const MapCoordinate3D& pos, Vehicle* &eht, const Context& context );
00067 virtual int finalCheck ( int currentPlayer, const Context& context );
00068 ~tsearchreactionfireingunits();
00069 };
00070
00071
00072
00073
00074 #endif