mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-01 16:05:35 +01:00
feat(editor): undo and redo take back the kept alignments and switches together with the paths: each step of the history keeps the //$h and //$r records from before it; a deleted switch or slip forgets its record in the same step, so undoing the deletion brings it back; edits of the switch number, rail and km and forgetting a kept design stay outside the history; self-test commands deleting paths
This commit is contained in:
@@ -57,5 +57,11 @@ void forget(std::string const &Name);
|
||||
void tidy();
|
||||
// "Rz 60E1-500-1:12 L", as the type is written on the lists of the switches
|
||||
std::string label(record const &Record);
|
||||
// the records as they were before the changes made since the last call, if there were any; the current ones become the base
|
||||
std::optional<std::vector<record>> take_changes();
|
||||
// the current records become the base, the changes made so far aren't a part of the undo history
|
||||
void settle();
|
||||
// puts the records back as they were, for undo and redo
|
||||
void restore(std::vector<record> Records);
|
||||
|
||||
} // namespace switch_store
|
||||
|
||||
Reference in New Issue
Block a user