Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

DiplomaticStateVector Class Reference

#include <player.h>

List of all members.

Public Member Functions

 DiplomaticStateVector (Player &_player)
DiplomaticStates getState (int towardsPlayer) const
void setState (int towardsPlayer, DiplomaticStates s, bool fireSignal=true)
void propose (int towardsPlayer, DiplomaticStates s)
void sneakAttack (int towardsPlayer)
bool isHostile (PlayerID towardsPlayer)
bool sharesView (PlayerID receivingPlayer)
bool isAllied (PlayerID towardsPlayer)
void turnBegins ()
void swap (int secondPlayer)
bool getProposal (int fromPlayer, DiplomaticStates *state)
void read (tnstream &stream)
void write (tnstream &stream) const

Static Public Attributes

static SigC::Signal4< void,
GameMap *, int, int, DiplomaticStates
anyStateChanged
static SigC::Signal3< void,
GameMap *, int, int > 
shareViewChanged

Friends

class AllianceSetupWidget


Constructor & Destructor Documentation

DiplomaticStateVector::DiplomaticStateVector Player _player  ) 
 

Definition at line 52 of file player.cpp.


Member Function Documentation

bool DiplomaticStateVector::getProposal int  fromPlayer,
DiplomaticStates state
 

Returns:
true if there are any proposals

Definition at line 236 of file player.cpp.

References assert, Player::getParentMap(), Player::getPosition(), and queuedStateChanges.

DiplomaticStates DiplomaticStateVector::getState int  towardsPlayer  )  const
 

Definition at line 81 of file player.cpp.

References ALLIANCE, Player::getPosition(), and WAR.

Referenced by AllianceSetupWidget::AllianceSetupWidget(), AllianceSetupWidget::Apply(), isAllied(), isHostile(), propose(), sharesView(), and turnBegins().

bool DiplomaticStateVector::isAllied PlayerID  towardsPlayer  )  [inline]
 

Definition at line 82 of file player.h.

References ALLIANCE, PlayerID::getID(), and getState().

Referenced by SelfDestruct::available(), GuiFunctions::OpenContainer::available(), CargoGuiFunctions::RecycleUnit::available(), and CargoGuiFunctions::OpenContainer::available().

bool DiplomaticStateVector::isHostile PlayerID  towardsPlayer  )  [inline]
 

Definition at line 80 of file player.h.

References PlayerID::getID(), getState(), and WAR.

Referenced by HiddenAStar3D::getMoveCost(), HiddenAStar::getMoveCost(), and AllEnemyUnitsDestroyed::getState().

void DiplomaticStateVector::propose int  towardsPlayer,
DiplomaticStates  s
 

Definition at line 183 of file player.cpp.

References assert, diplomaticStateNames, ASCString::format(), getmessage(), Player::getName(), Player::getParentMap(), Player::getPosition(), getState(), and queuedStateChanges.

Referenced by AllianceSetupWidget::Apply().

void DiplomaticStateVector::read tnstream stream  ) 
 

Definition at line 254 of file player.cpp.

Referenced by GameMap::read().

void DiplomaticStateVector::setState int  towardsPlayer,
DiplomaticStates  s,
bool  fireSignal = true
 

Definition at line 104 of file player.cpp.

References anyStateChanged, assert, Player::getParentMap(), and Player::getPosition().

Referenced by AllianceSetupWidget::Apply(), trunreplay::execnextreplaymove(), SetViewSharing::execute(), GameMap::read(), sneakAttack(), and turnBegins().

bool DiplomaticStateVector::sharesView PlayerID  receivingPlayer  )  [inline]
 

Definition at line 81 of file player.h.

References PlayerID::getID(), getState(), and PEACE_SV.

Referenced by PG_MapDisplay::displayMovingUnit(), evaluateviewcalculation(), and getPlayersWithSharedViewMask().

void DiplomaticStateVector::sneakAttack int  towardsPlayer  ) 
 

Definition at line 117 of file player.cpp.

References assert, ASCString::format(), getmessage(), Player::getName(), Player::getParentMap(), Player::getPosition(), setState(), and WAR.

Referenced by AllianceSetupWidget::Apply().

void DiplomaticStateVector::swap int  secondPlayer  ) 
 

Definition at line 565 of file player.cpp.

References Player::getParentMap(), Player::getPosition(), max(), queuedStateChanges, states, and swapData().

Referenced by Player::swap().

void DiplomaticStateVector::turnBegins  ) 
 

Definition at line 57 of file player.cpp.

References Player::getParentMap(), Player::getPosition(), getState(), queuedStateChanges, and setState().

void DiplomaticStateVector::write tnstream stream  )  const
 

Definition at line 272 of file player.cpp.

Referenced by GameMap::write().


Friends And Related Function Documentation

friend class AllianceSetupWidget [friend]
 

Definition at line 58 of file player.h.


Member Data Documentation

SigC::Signal4< void, GameMap *, int, int, DiplomaticStates > DiplomaticStateVector::anyStateChanged [static]
 

Definition at line 33 of file player.cpp.

Referenced by hookReplayToSystem(), and setState().

SigC::Signal3< void, GameMap *, int, int > DiplomaticStateVector::shareViewChanged [static]
 

Definition at line 37 of file player.cpp.

Referenced by gamethread().


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:17:07 2008 for Advanced Strategic Command by  doxygen 1.4.2