#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 | |
| bool | isActive_req (const Command *action) |
| returns if the command is active in the queued command list | |
| void | setActive (const Command *action, bool active) |
| const Actions & | getActions () const |
| ActionResult | undo (const Context &context) |
| does a single undo step | |
| ActionResult | redo (const Context &context) |
| does a single redo step | |
| ActionResult | rerun (const Context &context) |
| reruns the necessary commands to propage take the changes done by setActive to the map | |
| void | breakUndo () |
| to be called when some modification to the map is taking place that is not recorded by undo | |
| void | read (tnstream &stream) |
| void | write (tnstream &stream) |
| void | getCommands (AbstractCommandWriter &writer) |
| void | getActionDescriptions (vector< ASCString > &list) |
| ~ActionContainer () | |
Static Public Attributes | |
| static SigC::Signal2< void, GameMap *, const Command & > | postActionExecution |
| signales an executed Command. The command can still be undone after postActionExecution | |
| static SigC::Signal2< 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. | |
| static SigC::Signal1< void, GameMap * > | actionListChanged |
Definition at line 34 of file actioncontainer.h.
| typedef vector<Command*> ActionContainer::Actions |
Definition at line 39 of file actioncontainer.h.
| ActionContainer::ActionContainer | ( | GameMap * | gamemap | ) |
Definition at line 34 of file actioncontainer.cpp.
| ActionContainer::~ActionContainer | ( | ) |
Definition at line 283 of file actioncontainer.cpp.
| void ActionContainer::add | ( | Command * | action | ) |
Definition at line 41 of file actioncontainer.cpp.
References actionListChanged, and postActionExecution.
Referenced by GameAction::execute().
| 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::setActive | ( | const Command * | action, | |
| bool | active | |||
| ) |
| const Actions& ActionContainer::getActions | ( | ) | const [inline] |
Definition at line 63 of file actioncontainer.h.
Referenced by ActionFactory::restart(), and ActionFactory::spawnNextItem().
| 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().
| 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().
| 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::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::read | ( | tnstream & | stream | ) |
Definition at line 111 of file actioncontainer.cpp.
References actionContainerversion, GameAction::readFromStream(), and tnstream::readInt().
Referenced by GameMap::read().
| void ActionContainer::write | ( | tnstream & | stream | ) |
Definition at line 142 of file actioncontainer.cpp.
References actionContainerversion, and tnstream::writeInt().
Referenced by GameMap::write().
| void ActionContainer::getCommands | ( | AbstractCommandWriter & | writer | ) |
Definition at line 269 of file actioncontainer.cpp.
References isActive_map(), AbstractCommandWriter::printCommand(), and AbstractCommandWriter::printComment().
Referenced by writeLuaCommands().
Definition at line 172 of file actioncontainer.cpp.
SigC::Signal2< 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().
SigC::Signal2< 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::Signal1< void, GameMap * > ActionContainer::actionListChanged [static] |
Definition at line 91 of file actioncontainer.h.
Referenced by ActionInfoPanel::ActionInfoPanel(), add(), breakUndo(), redo(), and undo().
1.5.1