Advanced Strategic Command
Public Types | Public Member Functions | Static Public Attributes | List of all members
ActionContainer Class Reference

#include <actioncontainer.h>

Public Types

typedef vector< Command * > Actions
 

Public Member Functions

 ActionContainer (GameMap *gamemap)
 
void add (Command *action)
 
bool isActive_map (const Command *action) const
 returns if the command is active in the current map's state More...
 
bool isActive_req (const Command *action)
 returns if the command is active in the queued command list More...
 
void setActive (const Command *action, bool active)
 
const ActionsgetActions () const
 
ActionResult undo (const Context &context)
 does a single undo step More...
 
ActionResult redo (const Context &context)
 does a single redo step More...
 
ActionResult rerun (const Context &context)
 reruns the necessary commands to propage take the changes done by setActive to the map More...
 
void breakUndo ()
 to be called when some modification to the map is taking place that is not recorded by undo More...
 
void read (tnstream &stream)
 
void write (tnstream &stream)
 
void getCommands (AbstractCommandWriter &writer)
 
void getActionDescriptions (vector< ASCString > &list)
 
 ~ActionContainer ()
 

Static Public Attributes

static sigc::signal< void,
GameMap *, const Command & > 
postActionExecution
 signales an executed Command. The command can still be undone after postActionExecution More...
 
static sigc::signal< void,
GameMap *, Command & > 
commitCommand
 The command, which has already been executed, is finally commited and will not be undone any more This may be used to store it in the replay structure. More...
 
static sigc::signal< void,
GameMap * > 
actionListChanged
 

Detailed Description

Definition at line 34 of file actioncontainer.h.

Member Typedef Documentation

Definition at line 39 of file actioncontainer.h.

Constructor & Destructor Documentation

ActionContainer::ActionContainer ( GameMap gamemap)

Definition at line 34 of file actioncontainer.cpp.

ActionContainer::~ActionContainer ( )

Definition at line 282 of file actioncontainer.cpp.

Member Function Documentation

void ActionContainer::add ( Command action)

Definition at line 41 of file actioncontainer.cpp.

References actionListChanged, and postActionExecution.

Referenced by GameAction::execute().

void ActionContainer::breakUndo ( )

to be called when some modification to the map is taking place that is not recorded by undo

Definition at line 96 of file actioncontainer.cpp.

References actionListChanged, commitCommand, and isActive_map().

Referenced by GameMap::endTurn(), and Event::execute().

void ActionContainer::getActionDescriptions ( vector< ASCString > &  list)

Definition at line 172 of file actioncontainer.cpp.

const Actions& ActionContainer::getActions ( ) const
inline

Definition at line 63 of file actioncontainer.h.

Referenced by ActionFactory::restart(), and ActionFactory::spawnNextItem().

void ActionContainer::getCommands ( AbstractCommandWriter writer)
bool ActionContainer::isActive_map ( const Command action) const

returns if the command is active in the current map's state

Definition at line 190 of file actioncontainer.cpp.

References warningMessage().

Referenced by breakUndo(), getCommands(), rerun(), and undo().

bool ActionContainer::isActive_req ( const Command action)

returns if the command is active in the queued command list

Definition at line 200 of file actioncontainer.cpp.

Referenced by ActionSelectionWidget::ActionSelectionWidget().

void ActionContainer::read ( tnstream stream)
ActionResult ActionContainer::redo ( const Context context)

does a single redo step

Definition at line 79 of file actioncontainer.cpp.

References actionListChanged, errorMessage(), and ActionResult::getMessage().

Referenced by redo().

ActionResult ActionContainer::rerun ( const Context context)

reruns the necessary commands to propage take the changes done by setActive to the map

Definition at line 214 of file actioncontainer.cpp.

References fatalError(), isActive_map(), and ActionResult::successful().

void ActionContainer::setActive ( const Command action,
bool  active 
)

Definition at line 259 of file actioncontainer.cpp.

Referenced by ActionSelectionWidget::click().

ActionResult ActionContainer::undo ( const Context context)

does a single undo step

Definition at line 56 of file actioncontainer.cpp.

References actionListChanged, errorMessage(), ActionResult::getMessage(), and isActive_map().

Referenced by undo().

void ActionContainer::write ( tnstream stream)

Definition at line 142 of file actioncontainer.cpp.

References actionContainerversion, and tnstream::writeInt().

Referenced by GameMap::write().

Member Data Documentation

sigc::signal< void, GameMap * > ActionContainer::actionListChanged
static

Definition at line 91 of file actioncontainer.h.

Referenced by ActionInfoPanel::ActionInfoPanel(), add(), breakUndo(), redo(), and undo().

sigc::signal< void, GameMap *, Command & > ActionContainer::commitCommand
static

The command, which has already been executed, is finally commited and will not be undone any more This may be used to store it in the replay structure.

Definition at line 89 of file actioncontainer.h.

Referenced by breakUndo(), CampaignActionLogger::CampaignActionLogger(), hookReplayToSystem(), and TaskContainer::registerHooks().

sigc::signal< void, GameMap *, const Command & > ActionContainer::postActionExecution
static

signales an executed Command. The command can still be undone after postActionExecution

Definition at line 85 of file actioncontainer.h.

Referenced by add().


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