SetEntityLifespanCommand.h header
#include <ew/core/SetEntityLifespanCommand.h>
Namespace ew::core
SetEntityLifespanCommand class
class ew::core::SetEntityLifespanCommand
Command that sets an entity's birth and death instants (each optional; std::nullopt means unknown). Undo restores the previous lifespan and redo re-applies the new one.
Members
ew::core::SetEntityLifespanCommand::SetEntityLifespanCommand(Entity &entity, std::optional< qint64 > birth, std::optional< qint64 > death)
Creates a command that sets entity's birth to birth and death to death when applied.
ew::core::SetEntityLifespanCommand::~SetEntityLifespanCommand() override
Destroys the command.
void ew::core::SetEntityLifespanCommand::apply() override
Records the current lifespan and applies the new one.
void ew::core::SetEntityLifespanCommand::undo() override
Restores the previous lifespan.
QString ew::core::SetEntityLifespanCommand::description() const override
Returns a short description for the undo/redo UI.