Exemple #1
0
        public void Compute(char @operator, int operand)
        {
            Command command = new CalculatorCommand(
                _calculator, @operator, operand);

            command.Execute();
            _commands.Add(command);
            _current++;
        }
Exemple #2
0
        public int Compute(char @operator, int operand)
        {
            // Создаем команду операции и выполняем её
            Command command = new CalculatorCommand(
                calculator, @operator, operand);

            command.Execute();
            // Добавляем операцию к списку отмены
            commands.Add(command);
            current++;
            return(command.Execute());
        }