internal void RedoAction(GameAction action) { if (this._InternalRedoStack.Contains(action)) { GameAction current; do { current = this._InternalRedoStack[0]; current.ApplyEffect(); this._InternalUndoStack.Insert(0, current); this._InternalRedoStack.RemoveAt(0); } while (action != current); } this.UpdateHistoryCommands(); this.IsAIPaused = this.Turn && this.IsTruePlayerAI || !this.Turn && this.IsFalsePlayerAI; }
private void AddAction(GameAction action) { action.ApplyEffect(); this._InternalUndoStack.Insert(0, action); if (this._InternalUndoStack.Count() > 10) { this._InternalUndoStack.RemoveAt(this._InternalUndoStack.Count() - 1); } this._InternalRedoStack.Clear(); this.UpdateHistoryCommands(); }