public void Undo() { if (_previousBowlState == null) { throw new InvalidOperationException("No actions to undo"); } StoneIDs = _previousBowlState.StoneIDs.ToList(); _previousBowlState = _previousBowlState.PreviousState; PreviewStoneIDs = StoneIDs.ToList(); }
public void PrepForStateChange() { _previousBowlState = new PreviousBowlState(StoneIDs.ToList(), _previousBowlState); }