FastEcslent::Gather Class Reference

#include <gather.h>

Inheritance diagram for FastEcslent::Gather:

FastEcslent::UnitCommand FastEcslent::UnitCommand FastEcslent::UnitCommand FastEcslent::UnitCommand FastEcslent::UnitCommand FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command FastEcslent::Command

List of all members.

Public Member Functions

CommandCenter * findNearestCommandCenter ()
 Gather (Entity *ent, Target *target)
virtual void postProcess ()
virtual bool done ()
virtual void init ()
virtual void tick (double dt)
virtual Command * clone ()
void gatherTick (double dt)
void moveToEntityTick (Entity *ent, double dt)
void switchState (GatherState newState)
void switchMoveToState ()
CommandCenter * findNearestCommandCenter ()
 Gather (Entity *ent, Target *target)
virtual void postProcess ()
virtual bool done ()
virtual void init ()
virtual void tick (double dt)
void gatherTick (double dt)
void moveToEntityTick (Entity *ent, double dt)
void switchState (GatherState newState)
void switchMoveToState ()
CommandCenter * findNearestCommandCenter ()
 Gather (Entity *ent, Target *target)
virtual void postProcess ()
virtual bool done ()
virtual void init ()
virtual void tick (double dt)
void gatherTick (double dt)
void moveToEntityTick (Entity *ent, double dt)
void switchState (GatherState newState)
void switchMoveToState ()
CommandCenter * findNearestCommandCenter ()
 Gather (Entity *ent, Target *target)
virtual void postProcess ()
virtual bool done ()
virtual void init ()
virtual void tick (double dt)
void gatherTick (double dt)
void moveToEntityTick (Entity *ent, double dt)
void switchState (GatherState newState)
void switchMoveToState ()
CommandCenter * findNearestCommandCenter ()
 Gather (Entity *ent, Target *target)
virtual void postProcess ()
virtual bool done ()
virtual void init ()
virtual void tick (double dt)
void gatherTick (double dt)
void moveToEntityTick (Entity *ent, double dt)
void switchState (GatherState newState)
void switchMoveToState ()

Public Attributes

bool finished
Minerals * mineralEntity
Gas * gasEntity
CommandCenter * commandCenter
Minerals * mineralEntity
CommandCenter * commandCenter
Minerals * mineralEntity
CommandCenter * commandCenter
Minerals * mineralEntity
CommandCenter * commandCenter
Minerals * mineralEntity
CommandCenter * commandCenter

Private Attributes

GatherState state
SCVehicle * scv
bool isMineral
SCVehicle * scv
SCVehicle * scv
SCVehicle * scv
SCVehicle * scv


Detailed Description

Definition at line 33 of file gather.h.


Constructor & Destructor Documentation

FastEcslent::Gather::Gather ( Entity *  ent,
Target *  target 
)

Definition at line 13 of file gather.cpp.

References commandCenter, FastEcslent::Target::entity, FastEcslent::Entity::entityType, findNearestCommandCenter(), finished, gasEntity, mineralEntity, FastEcslent::MINERALS, FastEcslent::MOVETOMINERALS, scv, and state.

FastEcslent::Gather::Gather ( Entity *  ent,
Target *  target 
)

FastEcslent::Gather::Gather ( Entity *  ent,
Target *  target 
)

FastEcslent::Gather::Gather ( Entity *  ent,
Target *  target 
)

FastEcslent::Gather::Gather ( Entity *  ent,
Target *  target 
)


Member Function Documentation

FastEcslent::CommandCenter * FastEcslent::Gather::findNearestCommandCenter (  ) 

Definition at line 197 of file gather.cpp.

References FastEcslent::COMMANDCENTER, and DEBUG.

Referenced by Gather(), init(), and switchState().

void FastEcslent::Gather::postProcess (  )  [inline, virtual]

Inherited from base class Command This SCV was issued another command instead of Gather. 1. The number of miners of the mineral need decrease by 1 2. If the SCV is currently mining the mineral, the miner should be removed from the mineral.

See also:
command.h

Implements FastEcslent::Command.

Definition at line 47 of file gather.cpp.

References FastEcslent::Target::entity, FastEcslent::Entity::entityType, FastEcslent::Minerals::miner, FastEcslent::MINERALS, FastEcslent::Minerals::miners, and FastEcslent::UnitCommand::target.

bool FastEcslent::Gather::done (  )  [inline, virtual]

Implements FastEcslent::Command.

Definition at line 27 of file gather.cpp.

References finished.

void FastEcslent::Gather::init (  )  [inline, virtual]

Implements FastEcslent::Command.

Definition at line 31 of file gather.cpp.

References commandCenter, findNearestCommandCenter(), finished, mineralEntity, FastEcslent::Minerals::miners, FastEcslent::MOVETOMINERALS, and state.

Referenced by FastEcslent::createGatherForEntAndMineral().

void FastEcslent::Gather::tick ( double  dt  )  [inline, virtual]

Implements FastEcslent::Command.

Definition at line 77 of file gather.cpp.

References FastEcslent::GATHERINGMINERALS, gatherTick(), moveToEntityTick(), FastEcslent::MOVETOMINERALS, and FastEcslent::RETURNTOCC.

virtual Command* FastEcslent::Gather::clone (  )  [inline, virtual]

Reimplemented from FastEcslent::Command.

Definition at line 51 of file gather.h.

void FastEcslent::Gather::gatherTick ( double  dt  )  [inline]

Wait/Gather minerals If the SCV switched into gathering state, there are two possibilities: 1. Do nothing but wait, in case of another SCV is mining this mineral. 2. Mining, in case of nobody else is mining this mineral.

Definition at line 148 of file gather.cpp.

References FastEcslent::Entity::engine, FastEcslent::UnitCommand::entity, FastEcslent::GameMgr::findClosestEntityOfTypeWithinDistance(), FastEcslent::Engine::gameMgr, FastEcslent::Gas::gasAmount, FastEcslent::SCVehicle::gasCount, gasEntity, FastEcslent::SCVehicle::gasGatherRate, FastEcslent::SCVehicle::maxGasCount, FastEcslent::SCVehicle::maxMineralCount, FastEcslent::MaxMineralFindingDistance, FastEcslent::Gas::miner, FastEcslent::Minerals::miner, FastEcslent::Minerals::mineralAmount, FastEcslent::SCVehicle::mineralCount, mineralEntity, FastEcslent::SCVehicle::mineralGatherRate, FastEcslent::MINERALS, FastEcslent::RETURNTOCC, scv, FastEcslent::STOPPED, and switchState().

Referenced by tick().

void FastEcslent::Gather::moveToEntityTick ( Entity *  targetEnt,
double  dt 
) [inline]

The SCV moves to mining a mineral. When the SCV comes in front of the mineral, it will check if the target mineral is being mined by another SCV. If it is occupied, the SCV will check if there is optimal choice to mine (minerals with fewer miners in the same patch). If there is no optimal choice, wait until the target mineral is available. Otherwise, go to the optimal one.

Definition at line 114 of file gather.cpp.

References DEBUG, FastEcslent::Entity::desiredHeading, FastEcslent::Entity::desiredSpeed, FastEcslent::Entity::engine, FastEcslent::UnitCommand::entity, FastEcslent::Engine::gameMgr, FastEcslent::GameMgr::getMineralPatch(), FastEcslent::MineralPatch::getNextMineral(), FastEcslent::Entity::heading, FastEcslent::Entity::length, FastEcslent::Entity::maxSpeed, mineralEntity, FastEcslent::Minerals::miners, FastEcslent::Entity::pos, FastEcslent::UnitCommand::relativePos, scv, FastEcslent::Entity::speed, and switchMoveToState().

Referenced by tick().

void FastEcslent::Gather::switchState ( GatherState  newState  )  [inline]

Definition at line 57 of file gather.cpp.

References commandCenter, FastEcslent::Entity::engine, FastEcslent::UnitCommand::entity, FastEcslent::Entity::entityId, findNearestCommandCenter(), FastEcslent::Engine::gameMgr, FastEcslent::Resources::gas, FastEcslent::SCVehicle::gasCount, FastEcslent::GATHERINGMINERALS, FastEcslent::SCVehicle::mineralCount, FastEcslent::Resources::minerals, FastEcslent::MOVETOMINERALS, FastEcslent::Identity::player, FastEcslent::GameMgr::resources, FastEcslent::RETURNTOCC, scv, and state.

Referenced by gatherTick(), and switchMoveToState().

void FastEcslent::Gather::switchMoveToState (  ) 

Definition at line 99 of file gather.cpp.

References FastEcslent::GATHERINGMINERALS, FastEcslent::MOVETOMINERALS, FastEcslent::RETURNTOCC, and switchState().

Referenced by moveToEntityTick().

CommandCenter* FastEcslent::Gather::findNearestCommandCenter (  ) 

virtual void FastEcslent::Gather::postProcess (  )  [virtual]

Implements FastEcslent::Command.

virtual bool FastEcslent::Gather::done (  )  [virtual]

Implements FastEcslent::Command.

virtual void FastEcslent::Gather::init (  )  [virtual]

Implements FastEcslent::Command.

virtual void FastEcslent::Gather::tick ( double  dt  )  [virtual]

Implements FastEcslent::Command.

void FastEcslent::Gather::gatherTick ( double  dt  ) 

void FastEcslent::Gather::moveToEntityTick ( Entity *  ent,
double  dt 
)

void FastEcslent::Gather::switchState ( GatherState  newState  ) 

void FastEcslent::Gather::switchMoveToState (  ) 

CommandCenter* FastEcslent::Gather::findNearestCommandCenter (  ) 

virtual void FastEcslent::Gather::postProcess (  )  [virtual]

Implements FastEcslent::Command.

virtual bool FastEcslent::Gather::done (  )  [virtual]

Implements FastEcslent::Command.

virtual void FastEcslent::Gather::init (  )  [virtual]

Implements FastEcslent::Command.

virtual void FastEcslent::Gather::tick ( double  dt  )  [virtual]

Implements FastEcslent::Command.

void FastEcslent::Gather::gatherTick ( double  dt  ) 

void FastEcslent::Gather::moveToEntityTick ( Entity *  ent,
double  dt 
)

void FastEcslent::Gather::switchState ( GatherState  newState  ) 

void FastEcslent::Gather::switchMoveToState (  ) 

CommandCenter* FastEcslent::Gather::findNearestCommandCenter (  ) 

virtual void FastEcslent::Gather::postProcess (  )  [virtual]

Implements FastEcslent::Command.

virtual bool FastEcslent::Gather::done (  )  [virtual]

Implements FastEcslent::Command.

virtual void FastEcslent::Gather::init (  )  [virtual]

Implements FastEcslent::Command.

virtual void FastEcslent::Gather::tick ( double  dt  )  [virtual]

Implements FastEcslent::Command.

void FastEcslent::Gather::gatherTick ( double  dt  ) 

void FastEcslent::Gather::moveToEntityTick ( Entity *  ent,
double  dt 
)

void FastEcslent::Gather::switchState ( GatherState  newState  ) 

void FastEcslent::Gather::switchMoveToState (  ) 

CommandCenter* FastEcslent::Gather::findNearestCommandCenter (  ) 

virtual void FastEcslent::Gather::postProcess (  )  [virtual]

Implements FastEcslent::Command.

virtual bool FastEcslent::Gather::done (  )  [virtual]

Implements FastEcslent::Command.

virtual void FastEcslent::Gather::init (  )  [virtual]

Implements FastEcslent::Command.

virtual void FastEcslent::Gather::tick ( double  dt  )  [virtual]

Implements FastEcslent::Command.

void FastEcslent::Gather::gatherTick ( double  dt  ) 

void FastEcslent::Gather::moveToEntityTick ( Entity *  ent,
double  dt 
)

void FastEcslent::Gather::switchState ( GatherState  newState  ) 

void FastEcslent::Gather::switchMoveToState (  ) 


Member Data Documentation

GatherState FastEcslent::Gather::state [private]

Definition at line 35 of file gather.h.

Referenced by Gather(), init(), and switchState().

SCVehicle* FastEcslent::Gather::scv [private]

Definition at line 36 of file gather.h.

Referenced by Gather(), gatherTick(), moveToEntityTick(), and switchState().

bool FastEcslent::Gather::isMineral [private]

Definition at line 37 of file gather.h.

bool FastEcslent::Gather::finished

Definition at line 39 of file gather.h.

Referenced by done(), Gather(), and init().

Minerals* FastEcslent::Gather::mineralEntity

Definition at line 40 of file gather.h.

Referenced by Gather(), gatherTick(), init(), and moveToEntityTick().

Gas* FastEcslent::Gather::gasEntity

Definition at line 41 of file gather.h.

Referenced by Gather(), and gatherTick().

CommandCenter* FastEcslent::Gather::commandCenter

Definition at line 42 of file gather.h.

Referenced by Gather(), init(), and switchState().

SCVehicle* FastEcslent::Gather::scv [private]

Definition at line 36 of file gather.h.

Minerals* FastEcslent::Gather::mineralEntity

Definition at line 39 of file gather.h.

CommandCenter* FastEcslent::Gather::commandCenter

Definition at line 40 of file gather.h.

SCVehicle* FastEcslent::Gather::scv [private]

Definition at line 36 of file gather.h.

Minerals* FastEcslent::Gather::mineralEntity

Definition at line 39 of file gather.h.

CommandCenter* FastEcslent::Gather::commandCenter

Definition at line 40 of file gather.h.

SCVehicle* FastEcslent::Gather::scv [private]

Definition at line 36 of file gather.h.

Minerals* FastEcslent::Gather::mineralEntity

Definition at line 39 of file gather.h.

CommandCenter* FastEcslent::Gather::commandCenter

Definition at line 40 of file gather.h.

SCVehicle* FastEcslent::Gather::scv [private]

Definition at line 36 of file gather.h.

Minerals* FastEcslent::Gather::mineralEntity

Definition at line 39 of file gather.h.

CommandCenter* FastEcslent::Gather::commandCenter

Definition at line 40 of file gather.h.


The documentation for this class was generated from the following files:
Generated on Fri Dec 13 14:54:20 2013 for FastECSLent by  doxygen 1.5.4