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

#include <consumeglobalresource.h>

Inheritance diagram for ConsumeResource:
Inheritance graph
[legend]

Public Member Functions

 ConsumeResource (ContainerBase *container, const Resources &toGet)
 
ASCString getDescription () const
 
 ConsumeResource (ContainerBase *container, const Resources &toGet)
 
ASCString getDescription () const
 
- 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

virtual GameActionID getID () const
 
virtual ActionResult runAction (const Context &context)
 
virtual ActionResult undoAction (const Context &context)
 
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 void readData (tnstream &stream)
 
virtual void writeData (tnstream &stream) const
 
virtual GameActionID getID () const
 
virtual ActionResult runAction (const Context &context)
 
virtual ActionResult undoAction (const Context &context)
 
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 void readData (tnstream &stream)
 
virtual void writeData (tnstream &stream) const
 
- Protected Member Functions inherited from ContainerAction
void setID (int id)
 should usually not be called, the ID should only be set through the constructor More...
 
ContainerBasegetContainer (bool dontThrow=false)
 
const ContainerBasegetContainer (bool dontThrow=false) const
 
void readData (tnstream &stream)
 
void writeData (tnstream &stream) const
 
 ContainerAction (ContainerBase *container)
 
 ContainerAction (GameMap *map)
 
- 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 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)
 
template<class Child >
GameActionGameActionCreator (GameMap *map)
 

Additional Inherited Members

- Static Public Member Functions inherited from GameAction
static GameActionreadFromStream (tnstream &stream, GameMap *map)
 

Detailed Description

Definition at line 30 of file consumeglobalresource.h.

Constructor & Destructor Documentation

ConsumeResource::ConsumeResource ( ContainerBase container,
const Resources toGet 
)

Definition at line 27 of file consumeglobalresource.cpp.

ConsumeResource::ConsumeResource ( ContainerBase container,
const Resources toGet 
)

Member Function Documentation

ASCString ConsumeResource::getDescription ( ) const
virtual
ASCString ConsumeResource::getDescription ( ) const
virtual

Implements GameAction.

GameActionID ConsumeResource::getID ( ) const
protectedvirtual

Implements GameAction.

Definition at line 69 of file consumeglobalresource.cpp.

References ActionRegistry::ConsumeResource.

virtual GameActionID ConsumeResource::getID ( ) const
protectedvirtual

Implements GameAction.

ActionResult ConsumeResource::postCheck ( )
protectedvirtual

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.

The cheat detection of Replays heavily relies on this mechanism.

Reimplemented from GameAction.

Definition at line 87 of file consumeglobalresource.cpp.

virtual ActionResult ConsumeResource::postCheck ( )
protectedvirtual

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.

The cheat detection of Replays heavily relies on this mechanism.

Reimplemented from GameAction.

virtual void ConsumeResource::readData ( tnstream stream)
protectedvirtual

Implements GameAction.

void ConsumeResource::readData ( tnstream stream)
protectedvirtual
ActionResult ConsumeResource::runAction ( const Context context)
protectedvirtual
virtual ActionResult ConsumeResource::runAction ( const Context context)
protectedvirtual

Implements GameAction.

virtual ActionResult ConsumeResource::undoAction ( const Context context)
protectedvirtual

Implements GameAction.

ActionResult ConsumeResource::undoAction ( const Context context)
protectedvirtual
void ConsumeResource::writeData ( tnstream stream) const
protectedvirtual
virtual void ConsumeResource::writeData ( tnstream stream) const
protectedvirtual

Implements GameAction.

Friends And Related Function Documentation

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

Definition at line 114 of file action.h.

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: