public Doubler() { ExpectedResult = GetNewRandomNumber(); CurrentNumber = new OperationTarget(0); OperationsStack = new Stack <IOperationInterface> { }; }
public bool RevertOperation() { if (OperationsStack.Count == 0) { return(false); } IOperationInterface Operation = OperationsStack.Pop(); CurrentNumber = Operation.Revert(); return(true); }
private void ExecuteOperation(IOperationInterface operation) { CurrentNumber = operation.Execute(); OperationsStack.Push(operation); }
public void ResetCurrentNumberAndOperationStack() { CurrentNumber = new OperationTarget(0); OperationsStack.Clear(); }