Skip to content

Undo/redo leftover tasks #762

@NQNStudios

Description

@NQNStudios

Revise the inheritance tree of cAction

  • reversability becomes another class in the hierarchy, cReversibleAction
  • showChangeSite() becomes a virtual no-op in cAction. undo() and redo() are no longer virtual.

Refactor == functions and detail extractors

  • I learned at the VERY end of working on this, that std::array provides a suitable == so the loops I did aren't necessary.
  • make a comparator for monster ability union, clean up cMonster ==
  • detail getters/setters could be methods on the classes they work from.
  • OR, we could put the details structs into the classes directly and cut down on repetitive declarations. (This will be harder to do in cases where the details struct pulls in data from somewhere else outside the class)

Misc

  • use unions everywhere applicable
  • where similar operations have been made DRY in some places and not others, make them DRY across the board. (for example: 👍 functions returning a reference to the string list that must be popped from, instead of 👎 switch cases calling pop for each possible list)
  • frill terrain action, flood fill, automatic item placement, brush strokes change site should be the closest changed tile to the screen center when it ran
  • when the change site is a list on the main screen, it should scroll to show it

Designer names

Designer names are an open question. I've mentioned that I don't think they should be in the main undo history unless changing them is tied to changing the entity itself (like with boats and horses). We could do something to make all field changes undoable in dialogs, which would also be kinda neat if you don't wanna cancel your whole edit operation of something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions