PlayShots Class Reference

#include <PlayShots.h>

Inheritance diagram for PlayShots:

ServerShotHolder

List of all members.

Public Member Functions

 PlayShots ()
virtual ~PlayShots ()
void clearShots ()
bool haveShot (unsigned int playerId)
void createMessage (ComsPlayMovesMessage &message)
void readMessage (ComsPlayMovesMessage &message)
void playShots (ScorchedContext &context)

Protected Member Functions

void processPlayedMoveMessage (ScorchedContext &context, ComsPlayedMoveMessage &message, Tank *tank)
void processFiredMessage (ScorchedContext &context, ComsPlayedMoveMessage &message, Tank *tank)
void processResignMessage (ScorchedContext &context, ComsPlayedMoveMessage &message, Tank *tank)

Protected Attributes

std::map< unsigned
int,
ComsPlayedMoveMessage * > 
messages_


Detailed Description

Definition at line 30 of file PlayShots.h.


Constructor & Destructor Documentation

PlayShots::PlayShots (  ) 

Definition at line 35 of file PlayShots.cpp.

PlayShots::~PlayShots (  )  [virtual]

Definition at line 39 of file PlayShots.cpp.


Member Function Documentation

void PlayShots::clearShots (  ) 

Definition at line 66 of file PlayShots.cpp.

References messages_.

Referenced by ServerReadyState::enterState(), ServerNextShotState::enterState(), and readMessage().

bool PlayShots::haveShot ( unsigned int  playerId  ) 

Definition at line 78 of file PlayShots.cpp.

References messages_.

Referenced by ServerPlayingState::acceptStateChange(), ServerShotHolder::addShot(), ServerShotHolder::haveAllTurnShots(), and ServerShotHolder::sendWaitingMessage().

void PlayShots::createMessage ( ComsPlayMovesMessage message  ) 

Definition at line 43 of file PlayShots.cpp.

References ComsPlayMovesMessage::getMoves(), and messages_.

Referenced by ServerShotState::enterState().

void PlayShots::readMessage ( ComsPlayMovesMessage message  ) 

Definition at line 54 of file PlayShots.cpp.

References clearShots(), ComsPlayMovesMessage::getMoves(), and messages_.

Referenced by ClientShotState::processMessage().

void PlayShots::playShots ( ScorchedContext context  ) 

Definition at line 85 of file PlayShots.cpp.

References Tank::getScore(), TankContainer::getTankById(), ScorchedContext::getTankContainer(), messages_, processPlayedMoveMessage(), and TankScore::setMissedMoves().

Referenced by ShotState::setup().

void PlayShots::processPlayedMoveMessage ( ScorchedContext context,
ComsPlayedMoveMessage message,
Tank tank 
) [protected]

Definition at line 109 of file PlayShots.cpp.

References ComsPlayedMoveMessage::eFinishedBuy, ComsPlayedMoveMessage::eResign, ComsPlayedMoveMessage::eShot, ComsPlayedMoveMessage::eSkip, ComsPlayedMoveMessage::getType(), processFiredMessage(), and processResignMessage().

Referenced by playShots().

void PlayShots::processFiredMessage ( ScorchedContext context,
ComsPlayedMoveMessage message,
Tank tank 
) [protected]

Definition at line 159 of file PlayShots.cpp.

References ActionController::addAction(), TankPosition::changePower(), AccessoryStore::findByAccessoryId(), Weapon::fireWeapon(), Tank::getAccessories(), ScorchedContext::getAccessoryStore(), Accessory::getAction(), ScorchedContext::getActionController(), Target::getPlayerId(), Tank::getPosition(), TankPosition::getPower(), ComsPlayedMoveMessage::getPower(), ComsPlayedMoveMessage::getRotationXY(), ComsPlayedMoveMessage::getRotationYZ(), ComsPlayedMoveMessage::getSelectPositionX(), ComsPlayedMoveMessage::getSelectPositionY(), TankState::getState(), Tank::getState(), TankPosition::getTankGunPosition(), Accessory::getUseNumber(), TankPosition::getVelocityVector(), ComsPlayedMoveMessage::getWeaponId(), StatsLogger::instance(), TankAccessories::rm(), TankPosition::rotateGunXY(), TankPosition::rotateGunYZ(), TankPosition::setSelectPosition(), TankState::sNormal, StatsLogger::tankFired(), and StatsLogger::weaponFired().

Referenced by processPlayedMoveMessage().

void PlayShots::processResignMessage ( ScorchedContext context,
ComsPlayedMoveMessage message,
Tank tank 
) [protected]

Definition at line 134 of file PlayShots.cpp.

References ActionController::addAction(), ActionController::addLastAction(), ScorchedContext::getActionController(), TargetLife::getLife(), Target::getLife(), TargetLife::getMaxLife(), ScorchedContext::getOptionsGame(), Target::getPlayerId(), OptionsGame::ResignDueToHealth, and OptionsGame::ResignStart.

Referenced by processPlayedMoveMessage().


Member Data Documentation

std::map<unsigned int, ComsPlayedMoveMessage *> PlayShots::messages_ [protected]

Definition at line 45 of file PlayShots.h.

Referenced by ServerShotHolder::addShot(), ServerShotHolder::allSkipped(), clearShots(), createMessage(), haveShot(), playShots(), and readMessage().


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