Skip to main content

commands::SaveData

commands::SaveData

#include <SaveData.hpp>

Inherits from commands::ICommand

Public Functions

Name
SaveData(SaveDataParams p)
virtual std::string commandName() const override
Return the human-readable command name.
virtual std::string toJson() const override
Serialize command parameters to JSON.
virtual CommandResult execute(CommandContext const & ctx) override
Execute the command against the DataManager in ctx.

Additional inherited members

Public Functions inherited from commands::ICommand

Name
virtual ~ICommand() =default
virtual bool isUndoable() const
Report whether this command supports undo.
virtual CommandResult undo(CommandContext const & ctx)
Revert the effects of a prior execute() call.
virtual int mergeId() const
Return an identifier used for undo merging.
virtual bool mergeWith(ICommand const & other)
Attempt to merge this command with a subsequent command of the same type.

Public Functions Documentation

function SaveData

explicit SaveData(
    SaveDataParams p
)

function commandName

virtual std::string commandName() const override

Return the human-readable command name.

Return: Stable command name string.

Reimplements: commands::ICommand::commandName

Used for journal entries and UI display. Must match the name registered in CommandRegistry.

function toJson

virtual std::string toJson() const override

Serialize command parameters to JSON.

Return: JSON string representing the command parameters.

Reimplements: commands::ICommand::toJson

Typically implemented via rfl::json::write on the command’s params struct.

function execute

virtual CommandResult execute(
    CommandContext const & ctx
) override

Execute the command against the DataManager in ctx.

Parameters:

  • ctx Runtime execution context (DataManager, time controller, etc.).

Return: Success or failure result, including affected data keys on success.

Reimplements: commands::ICommand::execute


Updated on 2026-11-13 at 20:25:42 +0000