示例#1
0
        public void Execute(string[] splittedCommand, IPC pc, ILaptop laptop, IServer server)
        {
            var commandName = splittedCommand[0];
            var commandArguments = int.Parse(splittedCommand[1]);

            if (commandName == "Charge")
            {
                laptop.ChargeBattery(commandArguments);
            }
            else if (commandName == "Process")
            {
                server.Process(commandArguments);
            }
            else if (commandName == "Play")
            {
                pc.Play(commandArguments);
            }
        }