DiplomaticStateVector Class Reference

#include <player.h>

List of all members.

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)
 
Returns:
true if there are any proposals

void read (tnstream &stream)
void write (tnstream &stream) const

Friends

class AllianceSetupWidget
class ChangeDiplomaticState
class DiplomacyCommand


Detailed Description

Definition at line 56 of file player.h.


Constructor & Destructor Documentation

DiplomaticStateVector::DiplomaticStateVector ( Player _player  ) 

Definition at line 48 of file player.cpp.


Member Function Documentation

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 
)

Returns:
true if there are any proposals

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().


Friends And Related Function Documentation

friend class AllianceSetupWidget [friend]

Definition at line 58 of file player.h.

friend class ChangeDiplomaticState [friend]

Definition at line 59 of file player.h.

friend class DiplomacyCommand [friend]

Definition at line 60 of file player.h.


The documentation for this class was generated from the following files:
Generated on Mon May 21 01:46:39 2012 for Advanced Strategic Command by  doxygen 1.5.1