예제 #1
0
        private void AddNewWiimote(Wiimote NewWiimote)
        {
            if (AvailableIndices.Count == 0)
            {
                NewWiimote.Disconnect();
            }

            NewWiimote.WiimoteDisconnected += OnWiimoteDisconnected;
            NewWiimote.ButtonPressed       += OnButtonPressed;

            int WiimoteIndex = AvailableIndices[0];

            AvailableIndices.RemoveAt(0);

            Wiimote.WiimoteLED LED = Wiimote.WiimoteLED.ALL;

            switch (WiimoteIndex)
            {
            case 0:
                LED = Wiimote.WiimoteLED.LED1;
                break;

            case 1:
                LED = Wiimote.WiimoteLED.LED2;
                break;

            case 2:
                LED = Wiimote.WiimoteLED.LED3;
                break;

            case 3:
                LED = Wiimote.WiimoteLED.LED4;
                break;
            }

            NewWiimote.SetLED(LED);
            RumbleWiimote(NewWiimote);

            Buzzer.Add(new Buzzer("Team " + (WiimoteIndex + 1), BuzzerColors[WiimoteIndex], WiimoteIndex, NewWiimote));
            Buzzer.Sort();
            BuzzerPanel.Items.Refresh();
        }
예제 #2
0
        private void AddNewWiimote(Wiimote NewWiimote)
        {
            if (AvailableIndices.Count == 0)
            {
                NewWiimote.Disconnect();
            }

            NewWiimote.WiimoteDisconnected += OnWiimoteDisconnected;
            NewWiimote.ButtonPressed += OnButtonPressed;

            int WiimoteIndex = AvailableIndices[0];
            AvailableIndices.RemoveAt(0);

            Wiimote.WiimoteLED LED = Wiimote.WiimoteLED.ALL;

            switch (WiimoteIndex)
            {
                case 0:
                    LED = Wiimote.WiimoteLED.LED1;
                    break;
                case 1:
                    LED = Wiimote.WiimoteLED.LED2;
                    break;
                case 2:
                    LED = Wiimote.WiimoteLED.LED3;
                    break;
                case 3:
                    LED = Wiimote.WiimoteLED.LED4;
                    break;
            }

            NewWiimote.SetLED(LED);
            RumbleWiimote(NewWiimote);

            Buzzer.Add(new Buzzer("Team " + (WiimoteIndex + 1), BuzzerColors[WiimoteIndex], WiimoteIndex, NewWiimote));
            Buzzer.Sort();
            BuzzerPanel.Items.Refresh();
        }