Пример #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("請輸入玩家人數");
            var playerAmount = Convert.ToInt32(Console.ReadLine());

            var playStation    = new PlayStation();
            var nintendoSwitch = new NintendoSwitch();

            var gameConsoles = new List <GameConsoleAbstract>()
            {
                playStation,
                nintendoSwitch,
            };

            gameConsoles.ForEach(x => ShowDetail(x, playerAmount));

            Console.WriteLine("將PS插入手把擴充器,連接網路讀取遊戲\n");

            playStation.SetGamePadTool(new ExpansionGamePad());
            playStation.SetLoadGameWay(new NetworkLoadGame());

            ShowDetail(playStation, playerAmount);

            Console.WriteLine("將NS連接網路讀取遊戲\n");
            nintendoSwitch.SetLoadGameWay(new NetworkLoadGame());

            ShowDetail(nintendoSwitch, playerAmount);

            Console.ReadKey();
        }
Пример #2
0
        public override void Exec(Processor processor)
        {
            var duration = Duration.Evaluate(processor);

            if (duration > 0)
            {
                NintendoSwitch.GetInstance().Press(Key, duration);
                Thread.Sleep(duration);
            }
        }
Пример #3
0
 public override void Exec(Processor processor)
 {
     NintendoSwitch.GetInstance().Up(Key);
 }