unitBuilder.h

Go to the documentation of this file.
00001 /*
00002  * unitBuilder.h
00003  *
00004  *  Created on: Mar 2, 2013
00005  *      Author: sushil
00006  */
00007 
00008 #ifndef UNITBUILDER_H_
00009 #define UNITBUILDER_H_
00010 
00011 #include <aspect.h>
00012 #include <enums.h>
00013 
00014 namespace FastEcslent {
00015 
00016         class Building;
00017 
00018         class Builder: public UnitAspect {
00019         private:
00020             static const int MAX_QUEUE;
00021 
00022         public:
00023 
00024 //              double   timeLeft; /*! Time left to finish constructing the current unit */
00025 //              double   timeNeeded;
00026 //              Building *building;
00027 //              EntityType entityType;
00028             Ogre::Vector3 minBuildRadius;
00029             Ogre::Vector3 maxBuildRadius;
00030             
00031                 std::deque<EntityType> entityQueue; 
00032                 //bool buildableEntities[NENTITYTYPES]; /*! The type of entities the Builder aspect is allowed to construct */
00033                 //double buildTimeForEntity[NENTITYTYPES];
00034                 Entity *entityBeingBuilt; 
00035                 bool waitNetworkResponse;
00036 
00037                 //Builder(Building *ent, UnitAspectType ast, EntityType entType);
00038                 Builder(Entity *ent, UnitAspectType ast,Ogre::Vector3 minBuildRadius= Ogre::Vector3(0,0,0),Ogre::Vector3 maxBuildRadius= Ogre::Vector3(0,0,0));
00039                 ~Builder();
00040 
00041                 virtual void init();
00042                 virtual void tick(double dt);
00043 
00044                 void startBuildingNextEntity();
00045                 Ogre::Vector3 selectRandPosInRadius(int attempts);
00046                 bool enqueue(EntityType entityType);
00047                 bool removeAtIndex(unsigned int pos);
00048                 bool removeTail(void);
00049                 bool cancelEntityBeingBuilt();
00050 
00051         };
00052 
00053 
00054 
00055 }
00056 
00057 #endif /* UNITBUILDER_H_ */

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