BlankMat 0.1.0
Free open-source 3D texture creation application
Loading...
Searching...
No Matches
AddValueCommand< T > Class Template Reference
Inheritance diagram for AddValueCommand< T >:
Collaboration diagram for AddValueCommand< T >:

Public Member Functions

void Execute () override
 Executes this command.
 
void Undo () override
 Undoes this command.
 
bool Combine (ICommand *&other) override
 Combine this command with another command if they modify the same variable. WARNING: If combined, the other command is deleted and will be nullptr.
 
std::string GetName () const override
 Returns the name of this command.
 
 AddValueCommand (T *valueRef, const T &delta)
 Instantiates a command that adds the given value to the value of the given reference once the command is executed.
 
- Public Member Functions inherited from ICommand
bool Undoable () const
 Returns whether the command is undoable.
 
bool Trackable () const
 Returns whether the command is trackable (ie. should be stored in ActionStack)
 

Additional Inherited Members

- Protected Attributes inherited from ICommand
bool mCanBeUndone = true
 
bool mTrackable = true
 

Constructor & Destructor Documentation

◆ AddValueCommand()

template<typename T >
AddValueCommand< T >::AddValueCommand ( T *  valueRef,
const T &  delta 
)
inlineexplicit

Instantiates a command that adds the given value to the value of the given reference once the command is executed.

Parameters
valueRefReference to the variable to change
deltaValue to add to the variable

Member Function Documentation

◆ Combine()

template<typename T >
bool AddValueCommand< T >::Combine ( ICommand *&  other)
inlineoverridevirtual

Combine this command with another command if they modify the same variable. WARNING: If combined, the other command is deleted and will be nullptr.

Parameters
otherOther command to combine with
Returns
Whether the commands were combined

Implements ICommand.

◆ Execute()

template<typename T >
void AddValueCommand< T >::Execute ( )
inlineoverridevirtual

Executes this command.

Implements ICommand.

◆ GetName()

template<typename T >
std::string AddValueCommand< T >::GetName ( ) const
inlineoverridevirtual

Returns the name of this command.

Returns

Implements ICommand.

◆ Undo()

template<typename T >
void AddValueCommand< T >::Undo ( )
inlineoverridevirtual

Undoes this command.

Implements ICommand.