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

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

#include <cancelresearchcommand.h>

Inheritance diagram for CancelResearchCommand:
Inheritance graph
[legend]

Public Member Functions

 CancelResearchCommand (GameMap *map)
 
ActionResult preCheck ()
 preCheck is called before an action is redone and should check the preconditions for the action. More...
 
void setPlayer (const Player &player)
 
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)
 
void readData (tnstream &stream)
 
void writeData (tnstream &stream) const
 
ActionResult undoAction (const Context &context)
 
- 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 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
 

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 30 of file cancelresearchcommand.h.

Constructor & Destructor Documentation

CancelResearchCommand::CancelResearchCommand ( GameMap map)

Definition at line 28 of file cancelresearchcommand.cpp.

Member Function Documentation

ASCString CancelResearchCommand::getCommandString ( ) const
virtual

Implements Command.

Definition at line 146 of file cancelresearchcommand.cpp.

References ASCString::format().

ASCString CancelResearchCommand::getDescription ( ) const
protectedvirtual

Implements GameAction.

Definition at line 158 of file cancelresearchcommand.cpp.

References ASCString::toString().

GameActionID CancelResearchCommand::getID ( ) const
protectedvirtual

Implements GameAction.

Definition at line 153 of file cancelresearchcommand.cpp.

References ActionRegistry::CancelResearchCommand.

ActionResult CancelResearchCommand::go ( const Context context)
protectedvirtual
ActionResult CancelResearchCommand::preCheck ( )
virtual

preCheck is called before an action is redone and should check the preconditions for the action.

The map should be in exactly the same state as it was when the action was first run. This method should check various key indicators to insurce the unmodifiedness of the map. The cheat detection of Replays heavily relies on this mechanism.

Reimplemented from GameAction.

Definition at line 90 of file cancelresearchcommand.cpp.

References Research::activetechnology, GameAction::getMap(), GameMap::getPlayer(), Research::goal, Technology::id, Research::progress, and Player::research.

void CancelResearchCommand::readData ( tnstream stream)
protectedvirtual

Reimplemented from Command.

Definition at line 41 of file cancelresearchcommand.cpp.

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

void CancelResearchCommand::setPlayer ( const Player player)
ActionResult CancelResearchCommand::undoAction ( const Context context)
protectedvirtual
void CancelResearchCommand::writeData ( tnstream stream) const
protectedvirtual

Reimplemented from Command.

Definition at line 52 of file cancelresearchcommand.cpp.

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


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