Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/// <summary>
/// Move the ChangeController's current index forward by index.
/// Positive values only, wil only result in forward movement (if any).
/// </summary>
/// <param name="n">The number of times to move forward.</param>
public void Forward(int n = 1) {
if (n < 0)
throw new ArgumentOutOfRangeException(nameof(n));
for (int i = 0; i < n; i++) {
Change cur = _changes[++Index];
Current[cur.X, cur.Y] = cur.New;
SetDirty(new Vector2Int(cur.X, cur.Y));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment