BWAPI
BasicAIModule/source/Agents/UnitAgents/CommandCenterAgent.cpp
Go to the documentation of this file.
00001 /*
00002  * CommandCenterAgent.cpp
00003  */
00004 #include "CommandCenterAgent.h"
00005 #include "StructureAgent.h"
00006 
00007 #include <BWAPI.h>
00008 
00009 using namespace BWAPI;
00010 
00011 
00012 CommandCenterAgent::CommandCenterAgent(Unit &u) 
00013         : StructureAgent(u)
00014 {}
00015 
00016 void CommandCenterAgent::update()
00017 {
00018         switch (state)
00019         {
00020         case TrainState:
00021         if (!unit.isTraining() && !unit.isBeingConstructed() ) 
00022                 {
00023                         unit.train(UnitTypes::Terran_SCV);
00024                 }
00025                 break;
00026         }
00027 
00028         StructureAgent::update();
00029 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines