unitBuilder.cpp

Go to the documentation of this file.
00001 /*
00002  * unitBuilder.cpp
00003  *
00004  *  Created on: Mar 2, 2013
00005  *      Author: sushil
00006  */
00007 #include <ent.h>
00008 #include <buildings.h>
00009 #include <unitBuilder.h>
00010 
00011 namespace FastEcslent {
00012 
00013         Builder::Builder(Building *building, UnitAspectType aspectType, EntityType entType): UnitAspect(dynamic_cast<Entity *>(building), aspectType){
00014                 this->timeNeeded = 600.0;
00015                 this->timeLeft = -1.0;
00016                 this->building = building;
00017                 this->entityType  = entType;
00018 
00019         }
00020 
00021         Builder::~Builder(){
00022 
00023         }
00024 
00025 
00026         void Builder::init(){
00027 
00028 
00029         }
00030 
00031         void startBuildingNextEntity(){
00032 
00033         }
00034 
00035         void Builder::tick(double dt) {
00036                 if (!this->building->entityQueue.empty()){
00037                         //this->timeleft -= dt;
00038                         if (this->timeLeft < 0) {
00039                                 //this->building->engine->entityMgr->createEntityForPlayerAndSide(this->building->pos + offset, this->building->heading, this->building->entityId.side, this->building->entityId.player);
00040                                 this->building->entityQueue.pop_front();
00041                                 //startBuildingNextEntity();
00042                                 //create entity
00043                                 //popfront
00044                                 //start building new front ent
00045 
00046                         }
00047                 }
00048 
00049 
00050 
00051 
00052         }
00053 
00054 
00055 
00056 
00057 }

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