reactionfire.h

Go to the documentation of this file.
00001 /*
00002     This file is part of Advanced Strategic Command; http://www.asc-hq.de
00003     Copyright (C) 1994-2010  Martin Bickel  and  Marc Schellenberger
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; see the file COPYING. If not, write to the 
00017     Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
00018     Boston, MA  02111-1307  USA
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];     // f?r jede Hhenstufe eine
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

Generated on Mon May 21 01:26:36 2012 for Advanced Strategic Command by  doxygen 1.5.1