#include <PlayShots.h>

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_ |
Definition at line 30 of file PlayShots.h.
| PlayShots::PlayShots | ( | ) |
Definition at line 35 of file PlayShots.cpp.
| PlayShots::~PlayShots | ( | ) | [virtual] |
Definition at line 39 of file PlayShots.cpp.
| 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().
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().
1.5.3