gameMgr.h

Go to the documentation of this file.
00001 /*
00002  * gameMgr.h
00003  *
00004  *  Created on: Jan 9, 2012
00005  *      Author: sushil
00006  */
00007 
00008 #ifndef GAMEMGR_H_
00009 #define GAMEMGR_H_
00010 #include <const.h>
00011 #include <enums.h>
00012 #include <buildings.h>
00013 
00014 namespace FastEcslent {
00015 
00016         typedef struct { //SC2
00017                 int gas;
00018                 int minerals;
00019         } Resources;
00020 
00021         typedef struct { //SC2
00022                 int minerals;
00023                 int gas;
00024                 int supply; //pop
00025                 int buildTime;
00026                 int HotKey;
00027                 int transportSize;
00028                 int sightRange;
00029 
00030 
00031                 int hitPoints;
00032                 float armor;
00033                 float damage;
00034                 int   targetPriority;
00035                 float cooldown;
00036                 float range;
00037 
00038 
00039                 float speed;
00040                 float acc;
00041                 float dec;
00042                 float rotSpeed;
00043                 float collisionRadius;
00044 
00045                 EntityType neededTypes[MaxNeededTypes]; //for (int i=0; i < nNeededTypes; i++) needTypes[i] = BARRACKS;
00046                 int nNeededTypes; // if nNeededTypes == 0 , no prereqs
00047 
00048         } GameEntTypeProperties;
00049 
00050 
00051         class Engine;
00052 
00053         class GameMgr : public Mgr {
00054 
00055         private:
00056                 int gameNumber;
00057                 std::vector<MineralPatch*> mineralPatches;
00058 
00059         public:
00060 
00061                 Options options;
00062                 //game
00063                 int popCap[NPLAYERS];
00064                 int pop[NPLAYERS];
00065                 int currentPopCap[NPLAYERS];
00066                 int currentEntityCounts[NPLAYERS][NENTITYTYPES];
00067                 Entity *playerEnts[NPLAYERS][PerPlayerMaxEnts];
00068                 int     playerNEnts[NPLAYERS];
00069 
00070                 GameEntTypeProperties entTypeData[NENTITYTYPES];
00071                 Resources resources[NPLAYERS];
00072 
00073 
00074 
00075                 GameMgr();
00076                 GameMgr(Engine *eng, Options opts);
00077 
00078                 void init();
00079                 void tick(double dtime);
00080 
00081                 bool preReqExists(EntityType entType);
00082                 bool notExceedPopCap(Identity entId);
00083                 void setupEntityBuildTimes();
00084                 void setupEntitySupply();
00085 
00086                 //FastWater
00087                 void WaterCraft();
00088                 void makeBaseForSidePlayer(Side side, Player player, Ogre::Vector3 location, float offset, float yawOffset);
00089                 std::vector<Entity*> createNEntitiesRadial(EntityType entType, int n, Side side, Player player, Ogre::Vector3 location, float offset, float yawOffset, int yawOffsetMultiplier = 1);
00090                 void createMineralPatch(int n, Side side, Player player, Ogre::Vector3 location, float offset, float yawOffset, int yawOffsetMultiplier = 1);
00091                 void startMining(Side side, Player player);
00092                 Entity* findClosestEntityOfTypeWithinDistance(EntityType entityType, Ogre::Vector3 pos, float distance, Side side, Player player);
00093 
00094 
00095         //games
00096                 void game0();
00097                 void tester();
00098         };
00099 
00100 }
00101 
00102 
00103 #endif /* GAMEMGR_H_ */

Generated on Fri Dec 13 14:54:16 2013 for FastECSLent by  doxygen 1.5.4