Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

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-1999  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 
00032 class MapDisplayInterface;
00033 
00034 
00035 struct treactionfire_replayinfo {
00036          int x1 ;
00037          int y1 ;
00038          int x2 ;
00039          int y2 ;
00040          int ad1 ;
00041          int ad2 ;
00042          int dd1 ;
00043          int dd2 ;
00044          int wpnum;
00045 };
00046 
00047 
00048 
00049 class treactionfire {
00050           public:
00051              virtual int  checkfield ( const MapCoordinate3D& pos, Vehicle* &eht, MapDisplayInterface* md ) = 0;
00052              virtual void init ( Vehicle* eht, const AStar3D::Path&  fieldlist ) = 0;
00053              virtual int  finalCheck ( MapDisplayInterface* md, int currentPlayer ) = 0;
00054              virtual ~treactionfire() {};
00055         };
00056 
00057 class treactionfirereplay : public treactionfire {
00058           protected:
00059              int num;
00060              dynamic_array<treactionfire_replayinfo*> replay;
00061              Vehicle* unit;
00062           public:
00063              treactionfirereplay ( void );
00064              ~treactionfirereplay ( );
00065              virtual int checkfield ( const MapCoordinate3D& pos, Vehicle* &eht, MapDisplayInterface* md );
00066              virtual void init ( Vehicle* eht, const AStar3D::Path& fieldlist );
00067              virtual int  finalCheck ( MapDisplayInterface* md, int currentPlayer ) { return 0; };
00068 };
00069 
00070 class tsearchreactionfireingunits : public treactionfire {
00071            private: 
00072                 void initLimits();
00073                 void findOffensiveUnits( Vehicle* vehicle, int height, int x1, int y1, int x2, int y2 );
00074 
00075            protected:
00076                 int attack( Vehicle* attacker, Vehicle* target, MapDisplayInterface* md );
00077 
00078                 static int maxshootdist[8];     // f?r jede Hhenstufe eine
00079                 void addunit ( Vehicle* vehicle );
00080                 void removeunit ( Vehicle* vehicle );
00081                 
00082                 typedef map<const Vehicle*,int> VisibleUnits;
00083                 VisibleUnits visibleUnits;
00084                 
00085            public:
00086 
00087                 tsearchreactionfireingunits( void );
00088                 void init ( Vehicle* eht, const AStar3D::Path& fieldlist );
00089                 void init ( Vehicle* eht, const MapCoordinate3D& pos );
00090                 int  checkfield ( const MapCoordinate3D& pos, Vehicle* &eht, MapDisplayInterface* md );
00091                 virtual int  finalCheck ( MapDisplayInterface* md, int currentPlayer );
00092                 ~tsearchreactionfireingunits();
00093       };
00094 
00095   
00096     
00097 
00098 #endif

Generated on Tue Jun 24 01:27:50 2008 for Advanced Strategic Command by  doxygen 1.4.2