Пример #1
0
        private TaikoDrum ChangeTaikoBoolean(string property)
        {
            TaikoDrum tak = (TaikoDrum)Device.State;

            switch (property)
            {
            case INPUT_NAMES.TAIKO_DRUM.CENTER_LEFT: tak.centerLeft = !tak.centerLeft; break;

            case INPUT_NAMES.TAIKO_DRUM.CENTER_RIGHT: tak.centerRight = !tak.centerRight; break;

            case INPUT_NAMES.TAIKO_DRUM.RIM_LEFT: tak.rimLeft = !tak.rimLeft; break;

            case INPUT_NAMES.TAIKO_DRUM.RIM_RIGHT: tak.rimRight = !tak.rimRight; break;
            }

            return(tak);
        }
Пример #2
0
        public void ChangeExtension(ControllerType type)
        {
            if (DeviceType == type)
            {
                return;
            }

            switch (type)
            {
            case ControllerType.Wiimote:
                if (State is IWiimoteExtension)
                {
                    ConfigureWiimote(((IWiimoteExtension)State).wiimote);
                }
                else
                {
                    ConfigureWiimote(new Wiimote());
                }
                break;

            case ControllerType.Nunchuk:
            case ControllerType.NunchukB:
                var nState = new Nunchuk();
                nState.SetCalibration(Calibrations.CalibrationPreset.Default);
                ConfigureNunchuk(nState);
                ConfigureWiimote(nState.wiimote);
                break;

            case ControllerType.ClassicController:
                var cState = new ClassicController();
                cState.SetCalibration(Calibrations.CalibrationPreset.Default);
                ConfigureClassicController(cState);
                ConfigureWiimote(cState.wiimote);
                break;

            case ControllerType.ClassicControllerPro:
                var ccpState = new ClassicControllerPro();
                ccpState.SetCalibration(Calibrations.CalibrationPreset.Default);
                ConfigureClassicControllerPro(ccpState);
                ConfigureWiimote(ccpState.wiimote);
                break;

            case ControllerType.Guitar:
                var guitar = new Guitar();
                guitar.SetCalibration(Calibrations.CalibrationPreset.Default);
                ConfigureGuitar(guitar);
                ConfigureWiimote(guitar.wiimote);
                break;

            case ControllerType.TaikoDrum:
                var takio = new TaikoDrum();
                takio.SetCalibration(Calibrations.CalibrationPreset.Default);     // for wiimote
                ConfigureWiimote(takio.wiimote);
                break;

            default:
                // Invalid
                return;
            }

            DeviceType = type;
            _nextQueue.Enqueue(InputReport.Status);
        }