tile_edit package

Submodules

tile_edit_command module

class ui.dialogs.tile_edit.tile_edit_command.TileEditCommand(tile_data, old_state, new_state, tile_item=None)

Bases: QUndoCommand

QUndoCommand for editing a tile’s properties.

This command encapsulates the changes made to a tile, allowing undo and redo operations by storing the old and new states of the tile.

Parameters:
  • tile_data (TileData) – The TileData instance representing the tile being edited.

  • old_state (dict) – The previous state of the tile, as a dictionary.

  • new_state (dict) – The new state of the tile, as a dictionary.

  • tile_item (QGraphicsItem or None) – The graphical item associated with the tile, if any.

redo()

Apply the new state to the tile.

undo()

Revert the tile to its previous state.