Ejemplo n.º 1
0
        private void Update(Tuple <CalcEvent, string> evt)
        {
            string data = evt.Item2;

            switch (evt.Item1)
            {
            case CalcEvent.Clear: { accumulators = new Accumulators(); LinkedActor.SendMessage(accumulators); break; }

            case CalcEvent.Digit: { accumulators = accumulators.Enter(data); LinkedActor.SendMessage(accumulators); break; }

            case CalcEvent.Plus: { accumulators = accumulators.Plus(); LinkedActor.SendMessage(accumulators); break; }

            case CalcEvent.Moins: { accumulators = accumulators.Moins(); LinkedActor.SendMessage(accumulators); break; }

            case CalcEvent.Mult: { accumulators = accumulators.Mult(); LinkedActor.SendMessage(accumulators); break; }

            case CalcEvent.Div: { accumulators = accumulators.Div(); LinkedActor.SendMessage(accumulators); break; }

            case CalcEvent.Sign:
            {
                accumulators = accumulators.Sign();
                LinkedActor.SendMessage(accumulators);
                break;
            }

            default: break;
            }
        }