"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SGraphPropertyCommand = void 0; const SGraphCommand_1 = require("./SGraphCommand"); class SGraphPropertyCommand extends SGraphCommand_1.SGraphCommand { constructor(scene, item, propName, oldProp, newProp) { super(scene); this.item = item; this.propName = propName; this.oldProp = oldProp; this.newProp = newProp; this.command = "SGraphPropertyCommand"; this.command = `更新属性=${item.id}`; } redo() { this.item[this.propName] = this.newProp; this.item.update(); } undo() { this.item[this.propName] = this.oldProp; this.item.update(); } toString() { const propName = `propName=${this.propName}`; const oldProp = `oldProp=${JSON.stringify(this.oldProp)}`; const newProp = `newProp=${JSON.stringify(this.newProp)}`; return `${propName};\n${oldProp};\n${newProp}`; } } exports.SGraphPropertyCommand = SGraphPropertyCommand;