SetMapTokensCommand.h header

#include <ew/core/SetMapTokensCommand.h>

Namespace ew::core

SetMapTokensCommand class

class ew::core::SetMapTokensCommand

Command that replaces the full set of tokens on a map. A single command covers adding, moving, editing, and deleting tokens: the caller builds the new token list and applies it atomically. Undo restores the previous tokens.

Members

ew::core::SetMapTokensCommand::SetMapTokensCommand(Map &map, std::vector< MapToken > tokens)

Creates a command that sets map's tokens to tokens when applied.

ew::core::SetMapTokensCommand::~SetMapTokensCommand() override

Destroys the command.

void ew::core::SetMapTokensCommand::apply() override

Records the map's current tokens and applies the new ones.

void ew::core::SetMapTokensCommand::undo() override

Restores the previous tokens.

QString ew::core::SetMapTokensCommand::description() const override

Returns a short description for the undo/redo UI.