Created
November 25, 2020 19:06
-
-
Save Xevion/9874e661c476eceb43aa02f1f2b5a809 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <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