ActionController Class Reference

#include <ActionController.h>

Inheritance diagram for ActionController:

GameStateI

List of all members.

Public Member Functions

 ActionController ()
virtual ~ActionController ()
void addAction (Action *action)
void addLastAction (Action *action)
bool noReferencedActions ()
void resetTime ()
void clear (bool warn=false)
void setStopImmediately (bool stop)
bool & getActionLogging ()
bool & getActionProfiling ()
void logProfiledActions ()
void logActions ()
void addSyncCheck (const std::string &msg)
std::vector
< std::string > & 
getSyncCheck ()
RandomGeneratorgetRandom ()
EventContainergetEvents ()
fixed getActionTime ()
void setScorchedContext (ScorchedContext *context)
void setFast (fixed speedMult)
fixed getFast ()
virtual void simulate (const unsigned state, float frameTime)
virtual void draw (const unsigned state)

Protected Member Functions

bool allEvents ()
void stepActions (fixed frameTime)
void addNewActions ()
void addNewLastActions ()

Protected Attributes

ScorchedContextcontext_
EventContainer events_
RandomGenerator random_
std::list< Action * > newActions_
std::list< Action * > newLastActions_
std::vector
< std::string
syncCheck_
ActionList actions_
std::map
< std::string, int > 
actionProfile_
int referenceCount_
unsigned int actionNumber_
fixed speed_
fixed time_
fixed lastTraceTime_
fixed stepTime_
bool actionProfiling_
bool actionTracing_
bool actionEvents_
bool stopImmediately_

Classes

class  ActionList


Detailed Description

Definition at line 33 of file ActionController.h.


Constructor & Destructor Documentation

ActionController::ActionController (  ) 

Definition at line 28 of file ActionController.cpp.

ActionController::~ActionController (  )  [virtual]

Definition at line 40 of file ActionController.cpp.


Member Function Documentation

void ActionController::addAction ( Action action  ) 

Definition at line 200 of file ActionController.cpp.

References actionEvents_, actionNumber_, actionProfile_, actionProfiling_, addSyncCheck(), context_, S3D::formatStringBuffer(), Action::getActionDetails(), Action::getActionType(), fixed::getInternal(), ScorchedContext::getOptionsGame(), Action::getReferenced(), newActions_, Action::setActionEvent(), Action::setActionNumber(), Action::setActionStartTime(), Action::setScorchedContext(), and time_.

Referenced by WeaponNapalm::addNapalm(), addNewLastActions(), WeaponRoller::addRoller(), PhysicsParticleActionObject::bounceShieldHit(), TankDamage::calculateDamage(), TankFalling::collision(), TargetDamageCalc::damageTarget(), WeaponTypeAction::fireWeapon(), WeaponTeleport::fireWeapon(), WeaponTeamAction::fireWeapon(), WeaponSound::fireWeapon(), WeaponSkyFlash::fireWeapon(), WeaponProjectile::fireWeapon(), WeaponMoveTank::fireWeapon(), WeaponMessage::fireWeapon(), WeaponLightning::fireWeapon(), WeaponLaser::fireWeapon(), WeaponGiveWin::fireWeapon(), WeaponGiveScore::fireWeapon(), WeaponGivePower::fireWeapon(), WeaponGiveMoney::fireWeapon(), WeaponGiveLives::fireWeapon(), WeaponGiveLife::fireWeapon(), WeaponGiveAccessory::fireWeapon(), WeaponExplosion::fireWeapon(), WeaponDelay::fireWeapon(), WeaponAnimation::fireWeapon(), WeaponAddTarget::fireWeapon(), Teleport::init(), TankSay::init(), TankDamage::init(), ShotBounce::init(), Napalm::init(), Explosion::init(), TankDamage::logDeath(), TankMovement::moveTank(), PlayShots::processFiredMessage(), PlayShots::processResignMessage(), s3d_explosion(), s3d_laser(), s3d_napalm(), PhysicsParticleActionObject::shotShieldHit(), TankFired::simulate(), Laser::simulate(), CheckResurrection::simulate(), and WeaponRepeat::weaponCallback().

void ActionController::addLastAction ( Action action  ) 

Definition at line 238 of file ActionController.cpp.

References newLastActions_.

Referenced by PlayShots::processResignMessage(), and ShotState::setup().

bool ActionController::noReferencedActions (  ) 

Definition at line 154 of file ActionController.cpp.

References actionTracing_, lastTraceTime_, logActions(), newActions_, newLastActions_, referenceCount_, and time_.

Referenced by ShotState::run(), and simulate().

void ActionController::resetTime (  ) 

Definition at line 173 of file ActionController.cpp.

References lastTraceTime_, stepTime_, syncCheck_, and time_.

Referenced by ShotState::setup().

void ActionController::clear ( bool  warn = false  ) 

Definition at line 45 of file ActionController.cpp.

References ActionController::ActionList::actionCount, ActionController::ActionList::actions, actions_, ActionController::ActionList::clear(), S3D::formatStringBuffer(), Action::getActionType(), Action::getReferenced(), Logger::log(), newActions_, newLastActions_, and referenceCount_.

Referenced by ClientNewGameHandler::actualProcessMessage(), and ShotState::setup().

void ActionController::setStopImmediately ( bool  stop  )  [inline]

Definition at line 45 of file ActionController.h.

References stopImmediately_.

Referenced by ShotState::run(), and ShotState::setup().

bool& ActionController::getActionLogging (  )  [inline]

Definition at line 48 of file ActionController.h.

References actionTracing_.

bool& ActionController::getActionProfiling (  )  [inline]

Definition at line 49 of file ActionController.h.

References actionProfiling_.

void ActionController::logProfiledActions (  ) 

Definition at line 132 of file ActionController.cpp.

References actionProfile_, actionProfiling_, S3D::formatStringBuffer(), and Logger::log().

Referenced by ShotState::run().

void ActionController::logActions (  ) 

Definition at line 118 of file ActionController.cpp.

References ActionController::ActionList::actionCount, ActionController::ActionList::actions, actions_, fixed::asFloat(), S3D::formatStringBuffer(), Action::getActionType(), int(), Logger::log(), newActions_, newLastActions_, referenceCount_, and time_.

Referenced by noReferencedActions().

void ActionController::addSyncCheck ( const std::string msg  ) 

Definition at line 192 of file ActionController.cpp.

References context_, DIALOG_ASSERT, ScorchedContext::getOptionsGame(), stopImmediately_, and syncCheck_.

Referenced by addAction(), TankDamage::calculateDamage(), TankDamage::calculateDeath(), PhysicsParticleObject::checkCollision(), TankFalling::collision(), DeformLandscape::deformLandscape(), DeformLandscape::flattenArea(), TargetSpace::getCollision(), TargetSpace::getCollisionSet(), ShotState::setup(), Teleport::simulate(), Resurrection::simulate(), AddTarget::simulate(), stepActions(), and Boid2::update().

std::vector<std::string>& ActionController::getSyncCheck (  )  [inline]

Definition at line 55 of file ActionController.h.

References syncCheck_.

Referenced by ComsSyncCheckMessage::readMessage(), and ComsSyncCheckMessage::writeMessage().

RandomGenerator& ActionController::getRandom (  )  [inline]

Definition at line 57 of file ActionController.h.

References random_.

Referenced by WeaponRoller::addRoller(), Lightning::dispaceDirection(), ServerShotState::enterState(), WeaponScatterPosition::fireWeapon(), WeaponScatterDirection::fireWeapon(), WeaponRoller::fireWeapon(), WeaponRandomChoice::fireWeapon(), WeaponPosition::fireWeapon(), WeaponNapalm::fireWeapon(), WeaponMirv::fireWeapon(), WeaponGroupSelect::fireWeapon(), WeaponAimedUnder::fireWeapon(), WeaponAimedOver::fireWeapon(), Lightning::generateLightning(), TankAIStrings::getAttackLine(), TankAIStrings::getDeathLine(), LandscapeConditionRandom::getNextEventTime(), LandscapeConditionTime::getNextEventTime(), NumberParser::getValue(), CheckResurrection::simulate(), AddTarget::simulate(), and Napalm::simulateAddEdge().

EventContainer& ActionController::getEvents (  )  [inline]

Definition at line 58 of file ActionController.h.

References events_.

Referenced by ShotState::run(), and ShotState::setup().

fixed ActionController::getActionTime (  )  [inline]

Definition at line 59 of file ActionController.h.

References time_.

Referenced by CameraPositionAction::init(), and ShotState::run().

void ActionController::setScorchedContext ( ScorchedContext context  ) 

Definition at line 182 of file ActionController.cpp.

References context_.

Referenced by ScorchedContext::ScorchedContext().

void ActionController::setFast ( fixed  speedMult  ) 

Definition at line 187 of file ActionController.cpp.

References speed_.

Referenced by SpeedChange::setSpeed().

fixed ActionController::getFast (  )  [inline]

Definition at line 64 of file ActionController.h.

References speed_.

Referenced by SpeedChange::draw(), RenderTargets::Renderer3D::simulate(), and SpeedChange::simulate().

void ActionController::simulate ( const unsigned  state,
float  frameTime 
) [virtual]

Reimplemented from GameStateI.

Definition at line 284 of file ActionController.cpp.

References context_, fixed::fromFloat(), ScorchedContext::getOptionsGame(), noReferencedActions(), speed_, stepActions(), stepTime_, stopImmediately_, and time_.

Referenced by AnimatedBackdropDialog::simulate().

void ActionController::draw ( const unsigned  state  )  [virtual]

Reimplemented from GameStateI.

Definition at line 274 of file ActionController.cpp.

References ActionController::ActionList::actionCount, ActionController::ActionList::actions, actions_, and Action::draw().

Referenced by CameraDialog::drawLandscape().

bool ActionController::allEvents (  )  [protected]

Definition at line 95 of file ActionController.cpp.

References ActionController::ActionList::actionCount, ActionController::ActionList::actions, actions_, Action::getActionEvent(), Action::getReferenced(), and newActions_.

Referenced by stepActions().

void ActionController::stepActions ( fixed  frameTime  )  [protected]

Definition at line 306 of file ActionController.cpp.

References ActionController::ActionList::actionCount, actionEvents_, ActionController::ActionList::actions, actions_, addNewActions(), addNewLastActions(), addSyncCheck(), allEvents(), context_, events_, S3D::formatStringBuffer(), Action::getActionDetails(), Action::getActionStartTime(), Action::getActionType(), fixed::getInternal(), ScorchedContext::getOptionsGame(), Action::getReferenced(), ScorchedContext::getTargetMovement(), Logger::log(), referenceCount_, Action::simulate(), TargetMovement::simulate(), EventContainer::simulate(), and time_.

Referenced by simulate().

void ActionController::addNewActions (  )  [protected]

Definition at line 257 of file ActionController.cpp.

References actions_, context_, Action::getReferenced(), Action::init(), newActions_, ActionController::ActionList::push_back(), referenceCount_, Action::setActionStartTime(), Action::setScorchedContext(), and time_.

Referenced by stepActions().

void ActionController::addNewLastActions (  )  [protected]

Definition at line 243 of file ActionController.cpp.

References addAction(), newActions_, newLastActions_, and referenceCount_.

Referenced by stepActions().


Member Data Documentation

ScorchedContext* ActionController::context_ [protected]

Definition at line 102 of file ActionController.h.

Referenced by addAction(), addNewActions(), addSyncCheck(), setScorchedContext(), simulate(), and stepActions().

EventContainer ActionController::events_ [protected]

Definition at line 103 of file ActionController.h.

Referenced by getEvents(), and stepActions().

RandomGenerator ActionController::random_ [protected]

Definition at line 104 of file ActionController.h.

Referenced by getRandom().

std::list<Action *> ActionController::newActions_ [protected]

Definition at line 105 of file ActionController.h.

Referenced by addAction(), addNewActions(), addNewLastActions(), allEvents(), clear(), logActions(), and noReferencedActions().

std::list<Action *> ActionController::newLastActions_ [protected]

Definition at line 105 of file ActionController.h.

Referenced by addLastAction(), addNewLastActions(), clear(), logActions(), and noReferencedActions().

std::vector<std::string> ActionController::syncCheck_ [protected]

Definition at line 106 of file ActionController.h.

Referenced by addSyncCheck(), getSyncCheck(), and resetTime().

ActionList ActionController::actions_ [protected]

Definition at line 107 of file ActionController.h.

Referenced by addNewActions(), allEvents(), clear(), draw(), logActions(), and stepActions().

std::map<std::string, int> ActionController::actionProfile_ [protected]

Definition at line 108 of file ActionController.h.

Referenced by addAction(), and logProfiledActions().

int ActionController::referenceCount_ [protected]

Definition at line 109 of file ActionController.h.

Referenced by addNewActions(), addNewLastActions(), clear(), logActions(), noReferencedActions(), and stepActions().

unsigned int ActionController::actionNumber_ [protected]

Definition at line 110 of file ActionController.h.

Referenced by addAction().

fixed ActionController::speed_ [protected]

Definition at line 111 of file ActionController.h.

Referenced by getFast(), setFast(), and simulate().

fixed ActionController::time_ [protected]

Definition at line 112 of file ActionController.h.

Referenced by addAction(), addNewActions(), getActionTime(), logActions(), noReferencedActions(), resetTime(), simulate(), and stepActions().

fixed ActionController::lastTraceTime_ [protected]

Definition at line 113 of file ActionController.h.

Referenced by noReferencedActions(), and resetTime().

fixed ActionController::stepTime_ [protected]

Definition at line 114 of file ActionController.h.

Referenced by resetTime(), and simulate().

bool ActionController::actionProfiling_ [protected]

Definition at line 115 of file ActionController.h.

Referenced by addAction(), getActionProfiling(), and logProfiledActions().

bool ActionController::actionTracing_ [protected]

Definition at line 116 of file ActionController.h.

Referenced by getActionLogging(), and noReferencedActions().

bool ActionController::actionEvents_ [protected]

Definition at line 117 of file ActionController.h.

Referenced by addAction(), and stepActions().

bool ActionController::stopImmediately_ [protected]

Definition at line 118 of file ActionController.h.

Referenced by addSyncCheck(), setStopImmediately(), and simulate().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:00 2009 for Scorched3D by  doxygen 1.5.3