예제 #1
0
        public void Compute(char @operator, int operand)
        {
            // Create command operation and execute it
            Command command = new CalculatorCommand(
                _calculator, @operator, operand);

            command.Execute();

            // Add command to undo list
            _commands.Add(command);
            _current = _commands.Count;
        }
예제 #2
0
        public void Compute(char @operator, int operand)
        {
            Debug.Log("\n---- Compute ");
            // Create command operation and execute it
            Command command = new CalculatorCommand(
                _calculator, @operator, operand);

            command.Execute();

            _commands.RemoveRange(_current, _commands.Count - _current);
            // Add command to undo list
            _commands.Add(command);
            _current++;
        }