Basic API Structure #2

Merged
kske merged 12 commits from f/basics into develop 2021-12-11 21:45:59 +01:00
Showing only changes of commit ee6015b353 - Show all commits

View File

@ -15,8 +15,8 @@ public final class ChangeManager<C extends Change> {
private final List<C> changes = new LinkedList<>(); private final List<C> changes = new LinkedList<>();
private int index; private int index = -1;
kske marked this conversation as resolved Outdated
Outdated
Review

"Applies the given change and appends it to the change list."

"Applies the given change and appends it to the change list."
private int markedIndex; private int markedIndex = -1;
/** /**
* Applies the given change and appends it to the change list. * Applies the given change and appends it to the change list.
@ -27,6 +27,7 @@ public final class ChangeManager<C extends Change> {
public void addChange(C change) { public void addChange(C change) {
change.apply(); change.apply();
changes.add(change); changes.add(change);
kske marked this conversation as resolved Outdated
Outdated
Review

"Undoes the current change."

"Undoes the current change."
++index;
} }
kske marked this conversation as resolved Outdated
Outdated
Review

"whether an action was performed"

"whether an action was performed"
/** /**
@ -81,7 +82,7 @@ public final class ChangeManager<C extends Change> {
* @since 0.0.1 * @since 0.0.1
*/ */
public boolean isUndoAvailable() { public boolean isUndoAvailable() {
kske marked this conversation as resolved Outdated
Outdated
Review

"whether a change is present that can be redone"

"whether a change is present that can be redone"
return index > 0; return index > -1;
} }
/** /**