#include <player.h>
Public Member Functions | |
| DiplomaticStateVector (Player &_player) | |
| DiplomaticStates | getState (PlayerID towardsPlayer) const |
| void | setState (PlayerID towardsPlayer, DiplomaticStates s) |
| bool | isHostile (PlayerID towardsPlayer) const |
| bool | sharesView (PlayerID receivingPlayer) const |
| bool | isAllied (PlayerID towardsPlayer) const |
| void | turnBegins () |
| void | swap (int secondPlayer) |
| bool | getProposal (int fromPlayer, DiplomaticStates *state) |
| |
| void | read (tnstream &stream) |
| void | write (tnstream &stream) const |
Friends | |
| class | AllianceSetupWidget |
| class | ChangeDiplomaticState |
| class | DiplomacyCommand |
Definition at line 56 of file player.h.
| DiplomaticStateVector::DiplomaticStateVector | ( | Player & | _player | ) |
Definition at line 48 of file player.cpp.
| DiplomaticStates DiplomaticStateVector::getState | ( | PlayerID | towardsPlayer | ) | const |
Definition at line 92 of file player.cpp.
References ALLIANCE, PlayerID::getID(), Player::getPosition(), and WAR.
Referenced by AllianceSetupWidget::AllianceSetupWidget(), AllianceSetupWidget::Apply(), Mine::attacksunit(), ServiceChecker::check(), checkSymmetry(), SetViewSharing::execute(), executeUserAction(), getTransferLimitation(), DiplomacyCommand::go(), isAllied(), isHostile(), ChangeDiplomaticState::runAction(), sharesView(), swap(), testDiplomacy1(), testDiplomacy2(), testDiplomacy3(), and turnBegins().
| void DiplomaticStateVector::setState | ( | PlayerID | towardsPlayer, | |
| DiplomaticStates | s | |||
| ) |
Definition at line 115 of file player.cpp.
References PlayerID::getID().
Referenced by AllianceSetupWidget::Apply(), trunreplay::execnextreplaymove(), SetViewSharing::execute(), GameMap::read(), ChangeDiplomaticState::runAction(), swap(), turnBegins(), and ChangeDiplomaticState::undoAction().
| bool DiplomaticStateVector::isHostile | ( | PlayerID | towardsPlayer | ) | const [inline] |
Definition at line 79 of file player.h.
References PlayerID::getID(), getState(), and WAR.
Referenced by attackpossible(), attackpossible2n(), attackpossible2u(), calcMoveMalus(), Vehicle::ReactionFire::canPerformAttack(), tsearchreactionfireingunits::finalCheck(), HiddenAStar3D::getMoveCost(), HiddenAStar::getMoveCost(), AllEnemyBuildingsDestroyed::getState(), AllEnemyUnitsDestroyed::getState(), MoveUnit::runAction(), testDiplomacy1(), testDiplomacy2(), testDiplomacy3(), SearchReconquerBuilding::testfield(), ContainerBase::vehicleFit(), and ContainerBase::vehicleLoadable().
| bool DiplomaticStateVector::sharesView | ( | PlayerID | receivingPlayer | ) | const [inline] |
Definition at line 80 of file player.h.
References PlayerID::getID(), getState(), and PEACE_SV.
Referenced by ReplayMapDisplay::displayMovingUnit(), PG_MapDisplay::displayMovingUnit(), evaluateviewcalculation(), getPlayersWithSharedViewMask(), DiplomacyCommand::go(), VisibilityLayer::paintSingleField(), and viewterraininfo().
| bool DiplomaticStateVector::isAllied | ( | PlayerID | towardsPlayer | ) | const [inline] |
Definition at line 81 of file player.h.
References ALLIANCE, PlayerID::getID(), and getState().
Referenced by GuiFunctions::SelfDestructIcon::available(), GuiFunctions::InternalAmmoTransferDialog::available(), GuiFunctions::OpenContainer::available(), CargoGuiFunctions::RecycleUnitCommandButton::available(), CargoGuiFunctions::OpenContainer::available(), CargoGuiFunctions::UnitTraining::available(), ResearchWindow::available(), ResourceInfoWindow::available(), BuildingControlWindow::available(), NetControlWindow::available(), WindPowerWindow::available(), SolarPowerWindow::available(), fieldAccessible(), getTransferLimitation(), showCargoSummary(), testDiplomacy1(), testDiplomacy2(), and testDiplomacy3().
| void DiplomaticStateVector::turnBegins | ( | ) |
Definition at line 53 of file player.cpp.
References Player::diplomacy, Player::getParentMap(), GameMap::getPlayer(), GameMap::getPlayerCount(), Player::getPosition(), getProposal(), getState(), GameMap::player, queuedStateChanges, and setState().
| void DiplomaticStateVector::swap | ( | int | secondPlayer | ) |
Definition at line 462 of file player.cpp.
References Player::diplomacy, Player::getParentMap(), GameMap::getPlayer(), GameMap::getPlayerCount(), Player::getPosition(), getState(), queuedStateChanges, setState(), states, and swapData().
Referenced by Player::swap().
| bool DiplomaticStateVector::getProposal | ( | int | fromPlayer, | |
| DiplomaticStates * | state | |||
| ) |
Definition at line 127 of file player.cpp.
References Player::diplomacy, Player::getParentMap(), Player::getPosition(), GameMap::player, and queuedStateChanges.
Referenced by testDiplomacy1(), and turnBegins().
| void DiplomaticStateVector::read | ( | tnstream & | stream | ) |
Definition at line 145 of file player.cpp.
References tnstream::readInt().
Referenced by GameMap::read().
| void DiplomaticStateVector::write | ( | tnstream & | stream | ) | const |
Definition at line 163 of file player.cpp.
References tnstream::writeInt().
Referenced by GameMap::write().
friend class AllianceSetupWidget [friend] |
friend class ChangeDiplomaticState [friend] |
friend class DiplomacyCommand [friend] |
1.5.1