Advanced Strategic Command
Public Member Functions | Protected Member Functions | Friends | List of all members
DiplomacyCommand Class Reference

cancels the research on the current technology, losing all research points More...

#include <diplomacycommand.h>

Inheritance diagram for DiplomacyCommand:
Inheritance graph
[legend]

Public Member Functions

 DiplomacyCommand (Player &player)
 
void sneakAttack (Player &enemy)
 
void newstate (DiplomaticStates state, Player &towards)
 
ASCString getCommandString () const
 
- Public Member Functions inherited from Command
State getState () const
 
ActionResult redo (const Context &context)
 
virtual vector< MapCoordinategetCoordinates () const
 this is for informational purposes, so the player can see where a Command has taken place when reviewing it More...
 
- Public Member Functions inherited from GameAction
ActionResult execute (const Context &context)
 
ActionResult undo (const Context &context)
 
void read (tnstream &stream)
 
void write (tnstream &stream) const
 
void write (tnstream &stream, bool persistChildren) const
 
virtual ~GameAction ()
 

Protected Member Functions

GameActionID getID () const
 
ASCString getDescription () const
 
ActionResult go (const Context &context)
 
ActionResult undoAction (const Context &context)
 
void readData (tnstream &stream)
 
void writeData (tnstream &stream) const
 
- Protected Member Functions inherited from Command
 Command (GameMap *gamemap)
 
void setState (State state)
 
virtual ActionResult runAction (const Context &context)
 
virtual ActionResult checkExecutionPrecondition () const
 
- Protected Member Functions inherited from GameAction
void deleteChildren ()
 
 GameAction (GameMap *map)
 
void addChild (GameAction *action)
 adds a child action. Ownership of the child action is passed to THIS More...
 
virtual ActionResult preCheck ()
 preCheck is called before an action is redone and should check the preconditions for the action. More...
 
virtual ActionResult postCheck ()
 postCheck is called after an action has been redone and should check that the state of the map is exactly the same as it was after the action has been executed the first time. More...
 
virtual bool undoOrderChildFirst () const
 determines the order in which the child actions are undone. More...
 
GameMapgetMap ()
 
const GameMapgetMap () const
 

Friends

template<class Child >
GameActionGameActionCreator (GameMap *map)
 

Additional Inherited Members

- Public Types inherited from Command
enum  State {
  Planned, Evaluated, SetUp, Run,
  Finished, Failed
}
 
- Static Public Member Functions inherited from GameAction
static GameActionreadFromStream (tnstream &stream, GameMap *map)
 

Detailed Description

cancels the research on the current technology, losing all research points

Definition at line 29 of file diplomacycommand.h.

Constructor & Destructor Documentation

DiplomacyCommand::DiplomacyCommand ( Player player)

Definition at line 39 of file diplomacycommand.cpp.

Member Function Documentation

ASCString DiplomacyCommand::getCommandString ( ) const
virtual

Implements Command.

Definition at line 274 of file diplomacycommand.cpp.

References ASCString::format().

ASCString DiplomacyCommand::getDescription ( ) const
protectedvirtual
GameActionID DiplomacyCommand::getID ( ) const
protectedvirtual

Implements GameAction.

Definition at line 281 of file diplomacycommand.cpp.

References ActionRegistry::DiplomacyCommand.

ActionResult DiplomacyCommand::go ( const Context context)
protectedvirtual
void DiplomacyCommand::newstate ( DiplomaticStates  state,
Player towards 
)

Definition at line 80 of file diplomacycommand.cpp.

References Player::getPosition(), Command::setState(), and Command::SetUp.

Referenced by testDiplomacy1().

void DiplomacyCommand::readData ( tnstream stream)
protectedvirtual

Reimplemented from Command.

Definition at line 48 of file diplomacycommand.cpp.

References readClassContainer(), Command::readData(), and tnstream::readInt().

void DiplomacyCommand::sneakAttack ( Player enemy)

Definition at line 72 of file diplomacycommand.cpp.

References Player::getPosition(), Command::setState(), Command::SetUp, and WAR.

Referenced by testDiplomacy1().

ActionResult DiplomacyCommand::undoAction ( const Context context)
protectedvirtual

Reimplemented from Command.

Definition at line 265 of file diplomacycommand.cpp.

References Command::undoAction().

void DiplomacyCommand::writeData ( tnstream stream) const
protectedvirtual

Reimplemented from Command.

Definition at line 60 of file diplomacycommand.cpp.

References writeClassContainer(), Command::writeData(), and tnstream::writeInt().

Friends And Related Function Documentation

template<class Child >
GameAction* GameActionCreator ( GameMap map)
friend

Definition at line 114 of file action.h.


The documentation for this class was generated from the following files: