Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

BattleGroup.h

Go to the documentation of this file.
00001 /*
00002 CS Senior Project 2003
00003 Team : Leftfield
00004 Project : ModernWarfare
00005 Members :
00006 - Russ Christensen              <rchriste@cs.utah.edu>
00007 - Todd Smith                    <tcsmith@cs.utah.edu>
00008 - Usit Duongsaa                 <duongsaa@cs.utah.edu>
00009 Copyright 2003 Russ Christensen, Usit Duongsaa, and Todd Smith. All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
00012 
00013 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 
00014 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 
00015 THIS SOFTWARE IS PROVIDED BY RUSS CHRISTENSEN, USIT DUONGSAA, AND TODD SMITH ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RUSS, USIT, TODD OR OTHER CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00016 */
00017 
00022 #ifndef INCLUDE_BATTLEGROUP
00023 #define INCLUDE_BATTLEGROUP
00024 
00025 #include "..\AEngine\AEngine.h"
00026 #include "Globals.h"
00027 #include "BattleUnit.h"
00028 #include "BattleBullet.h"
00029 
00030 using namespace Globals;
00031 
00032 const int MAX_UNIT      =       30;
00033 
00034 class BattleState;
00035 
00036 //------------------------------------------------------------------------------------
00039 class BattleGroup
00040 {
00041 public:
00042         BattleGroup( Vec3D pos, Vec3D dir, char team, Vec3D color, int unitType, int numUnits, int overheadForceNumber );
00043 
00044         void addWaypoint( const Vec3D pt );
00045 
00047         void moveBattleGroup();
00048 
00050         void moveUnits();
00051 
00053         void acquireGroupTargets();
00054 
00056         void fire();
00057 
00059         void fireAntiAir();
00060 
00062         void takeHit( const BattleBullet &b );
00063 
00065         void destroyUnit( BattleUnit &u );
00066 
00067         // check if a 2D screen-coord point is inside the group's bounding box
00068         bool isContain2DPoint( Vec2D pt );
00069 
00070         void drawOutlineBox( Vec3D c );
00071 
00072         void render();
00073         
00074         BattleState *BS;
00075 
00076         char    m_team;
00077         Vec3D   m_pos, m_size, m_dir, m_color;
00078         int             m_unitType;
00079         int             m_unitArraySize;                // the number of entries in the array m_units that should be considered
00080                                                                         // *note* not all units in this array is alive
00081         int             m_numUnits;                             // number of 'alive' units in array
00082 
00083         FLOAT   m_maxUnitDist;          // max dist of a unit from its target
00084         
00085         vector<Vec3D>   m_waypoints;
00086         vector<int>             m_targetGroups;
00087         BattleUnit              m_units[MAX_UNIT];
00088 
00089         FLOAT   m_statFiringRange;
00090 
00091         int             m_primaryTarget;
00092         bool    m_isChasePrimaryTarget;
00093         bool    m_isStrictPrimaryTarget;        // if not strict (automatically picked by AI and not by user),
00094                                                                                 // the group may change to a more appropriate primary target
00095 
00096         int    m_overheadForceNumber;           // if in overheadmode you do CTRL+0..9 this number is the keycode for 0..9
00097 };
00098 //------------------------------------------------------------------------------------
00099 
00100 #endif

Generated on Wed Apr 23 05:50:14 2003 for Modern Warfare by doxygen1.3-rc2