Sly Engine
KillCommand Class Reference

#include <KillCommand.h>

Inheritance diagram for KillCommand:
Inheritance graph
Collaboration diagram for KillCommand:
Collaboration graph

Public Types

typedef std::list< KillCommand * > ItemList
 Defines an alias representing list of items. More...
 
typedef ItemList::iterator StorageRef
 

Public Member Functions

 KillCommand ()
 Default Constructor. More...
 
 KillCommand (const KillCommand &)=delete
 Copy Constructor. More...
 
 KillCommand (KillCommand &&)=delete
 Move operator. More...
 
KillCommandoperator= (const KillCommand &)=delete
 Copy assignment operator. More...
 
KillCommandoperator= (KillCommand &&)=delete
 Move assignment operator. More...
 
virtual ~KillCommand ()=default
 Destructor (Virtual from CommandBase) More...
 
 KillCommand (GameObject *toKill)
 Specialized constructor. More...
 
virtual void execute () override
 Kills the stored game object. More...
 
void setObject (GameObject *target, StorageRef ref)
 Sets an object. More...
 
StorageRef getDeleteRef ()
 
- Public Member Functions inherited from ConsoleCommand
 ConsoleCommand ()=default
 Default Constructor. More...
 
 ConsoleCommand (const ConsoleCommand &)=delete
 Copy Constructor. More...
 
 ConsoleCommand (ConsoleCommand &&)=delete
 Move operator. More...
 
ConsoleCommandoperator= (const ConsoleCommand &)=delete
 Copy assignment operator. More...
 
ConsoleCommandoperator= (ConsoleCommand &&)=delete
 Move assignment operator. More...
 
virtual ~ConsoleCommand ()=default
 Destructor (Virtual from CommandBase) More...
 
virtual void initialize (std::vector< std::string > arguments)
 Initializer list of arguments. More...
 
- Public Member Functions inherited from CommandBase
 CommandBase ()=default
 Default constructor. More...
 
 CommandBase (const CommandBase &)=delete
 Copy constructor. More...
 
 CommandBase (CommandBase &&)=delete
 Move constructor. More...
 
CommandBaseoperator= (const CommandBase &)=delete
 Assignment operator. More...
 
CommandBaseoperator= (CommandBase &&)=delete
 Move assignment operator. More...
 
virtual ~CommandBase ()=default
 Deconstructor. More...
 

Private Attributes

StorageRef myStorageRef
 
GameObjecttarget
 

Member Typedef Documentation

◆ ItemList

Defines an alias representing list of items.

◆ StorageRef

typedef ItemList::iterator KillCommand::StorageRef

Constructor & Destructor Documentation

◆ KillCommand() [1/4]

KillCommand::KillCommand ( )

Default Constructor.

◆ KillCommand() [2/4]

KillCommand::KillCommand ( const KillCommand )
delete

Copy Constructor.

◆ KillCommand() [3/4]

KillCommand::KillCommand ( KillCommand &&  )
delete

Move operator.

◆ ~KillCommand()

virtual KillCommand::~KillCommand ( )
virtualdefault

Destructor (Virtual from CommandBase)

◆ KillCommand() [4/4]

KillCommand::KillCommand ( GameObject toKill)

Specialized constructor.

Parameters
[in,out]toKillIf non-null, the object to kill.

The kill command requires a specific object to be initialized in order to kill. This object must be a game object with the SceneExit() function overridden. If this method is not overriden, the base class SceneExit() for GameObject will be called and nothing will happen.

Member Function Documentation

◆ execute()

void KillCommand::execute ( )
overridevirtual

Kills the stored game object.

Implements ConsoleCommand.

Here is the call graph for this function:

◆ getDeleteRef()

KillCommand::StorageRef KillCommand::getDeleteRef ( )
Here is the caller graph for this function:

◆ operator=() [1/2]

KillCommand& KillCommand::operator= ( const KillCommand )
delete

Copy assignment operator.

◆ operator=() [2/2]

KillCommand& KillCommand::operator= ( KillCommand &&  )
delete

Move assignment operator.

◆ setObject()

void KillCommand::setObject ( GameObject target,
StorageRef  ref 
)

Sets an object.

Parameters
[in,out]targetIf non-null, target for the.
refThe reference.
Here is the caller graph for this function:

Member Data Documentation

◆ myStorageRef

StorageRef KillCommand::myStorageRef
private

◆ target

GameObject* KillCommand::target
private

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