protected override ICalculatorState OnSave(Save save) { if (_hasNewOperand) { save.Invoke(_tempCtx); Ctx.GetMemory().SetValue(_tempCtx.GetMemory().GetValue()); } else { save.Invoke(Ctx); } return(this); }
public void Invoke(CalculatorContext ctx) { ctx.Ans = ctx.GetMemory().GetValue(); }