00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00022 #ifndef INCLUDE_BATTLEENTRY
00023 #define INCLUDE_BATTLEENTRY
00024
00025 #include "..\AEngine\AEngine.h"
00026 #include "BattleGroup.h"
00027 #include "BattleState.h"
00028 #include "BattleUnitStat.h"
00029 #include "UniqueID.h"
00030
00031
00032
00035
00036 {
00037
00038 public:
00039
00044 BattleEntry( const Vec3D teamAColor, const Vec3D teamBColor, const Vec2D location );
00045
00047 void input();
00048
00051 void update();
00052
00054 void render();
00055
00058 bool isBattleFinished();
00059
00061 Vec3D getWinningTeamColor();
00062
00063 Vec3D getTeamAColor() { return m_teamAColor; }
00064 Vec3D getTeamBColor() { return m_teamBColor; }
00065
00068 vector<Int3Tuple> teamAGroups, teamBGroups;
00069
00071 vector<Int3Tuple> getSurvivors();
00072
00074 Vec2D getBattleLocation();
00075
00077 bool isFoughtBy(const Vec3D& teamColor) const;
00078
00080 void enQueueInput( string cmd );
00081
00082 void processQueuedInput();
00083
00085 bool maySendGroundReinforcement( Vec3D playerColor );
00086 bool maySendAirReinforcement( Vec3D playerColor );
00087
00089 void sendGroundReinforcement( Vec3D playerColor, int unitType, int numUnits, int forceNum=0 );
00090 void sendAirReinforcement( Vec3D playerColor, int numJets, int homeTown );
00091
00093 bool contains(Vec3D pt);
00094
00095 void clearUnitSelection();
00096
00097
00098 int countGroupsBelongingToPlayer( Vec3D playerColor );
00099
00100 inline BattleState *getBSPtr() { return BS; };
00101
00102
00103
00104
00105 protected:
00106 void initBattle();
00107
00108 Vec3D m_teamAColor, m_teamBColor;
00109 Vec2D m_location;
00110
00111 int m_rfmCalledA, m_rfmCalledB;
00112
00113
00114 bool m_firstTime;
00115
00116 Vec3D m_camTarget;
00117 FLOAT m_camHeight;
00118 bool m_showBigMiniMap;
00119
00120 int m_selected;
00121 int m_ctrlGroup[10];
00122
00123 char m_winner;
00124 BattleState *BS;
00125
00126 list<string> m_cmdQueue;
00127
00128 char getTeamCode(int selected);
00129 int getGroupAtPos2D( Vec2D pos );
00130
00131 void inputSelectGroups();
00132 void inputSelectJets();
00133 void inputIssueGroupCommand();
00134 void inputIssueJetsCommand();
00135 void inputCtrlGroup();
00136 void inputSelectByHotKey();
00137
00138 void updateGroups();
00139 void updateJets();
00140 void updateBullets();
00141 void updateParticles();
00142 void updateDebris();
00143
00144 void renderEnvironment();
00145 void renderGroups();
00146 void renderJets();
00147 void renderBullets();
00148 void renderParticles();
00149 void renderDebris();
00150 void renderInterface();
00151 void renderMiniMap();
00152
00153 };
00154
00155
00156 #endif