public Controller(ControllerProfile pureControllerData) { ControllerData controlData = new ControllerData { upDpad = pureControllerData.UpDpad.CreateButton(), downDpad = pureControllerData.DownDpad.CreateButton(), leftDpad = pureControllerData.LeftDpad.CreateButton(), rightDpad = pureControllerData.RightDpad.CreateButton(), xAxisJoystickLeft = pureControllerData.XAxisLeft.CreateButton(), yAxisJoystickLeft = pureControllerData.YAxisLeft.CreateButton(), xAxisJoystickRight = pureControllerData.XAxisRight.CreateButton(), yAxisJoystickRight = pureControllerData.YAxisRight.CreateButton(), a = pureControllerData.A.CreateButton(), b = pureControllerData.B.CreateButton(), x = pureControllerData.X.CreateButton(), y = pureControllerData.Y.CreateButton(), l = pureControllerData.L.CreateButton(), r = pureControllerData.R.CreateButton(), l2 = pureControllerData.L2.CreateButton(), r2 = pureControllerData.R2.CreateButton(), jClickLeft = pureControllerData.JoyClickLeft.CreateButton(), jClickRight = pureControllerData.JoyClickRight.CreateButton(), start = pureControllerData.Start.CreateButton(), select = pureControllerData.Select.CreateButton(), controllerIndex = 0, name = pureControllerData.Name, leftJoystickToggle = pureControllerData.JoyToggleLeft.CreateButton(), rightJoystickToggle = pureControllerData.JoyToggleRight.CreateButton(), altA = pureControllerData.ExtraA.CreateButton() }; InitControllerFromData(controlData); }
/** Aug 19 2017 * leftJoystickToggle, rightJoystickToggle, altA * are passed even if not used. This is for overrides. * They are not passed here. */ protected virtual void InitControllerFromData(ControllerData data) { List <IButton> initializerInputs = new List <IButton>(new[] { data.upDpad, data.downDpad, data.leftDpad, data.rightDpad, data.xAxisJoystickLeft, data.yAxisJoystickLeft, data.xAxisJoystickRight, data.yAxisJoystickRight, data.a, data.b, data.x, data.y, data.l, data.r, data.l2, data.r2, data.jClickLeft, data.jClickRight, data.start, data.select }); _inputs = new List <IButton>(); _name = data.name; _controllerId = data.controllerIndex; foreach (IButton button in initializerInputs) { _inputs.Add(button); } InitController(); }
public GlobalController(IController gameController, IController pcController, IController pcAltController) { _gameController = gameController; _pcController = pcController; _pcAltController = pcAltController; _upActionDpad = new MultiButton(new List <IButton> { gameController.UpDpad, pcController.UpDpad, pcAltController.UpDpad, }); _downActionDPad = new MultiButton(new List <IButton> { gameController.DownDpad, pcController.DownDpad, pcAltController.DownDpad, }); _leftActionDPad = new MultiButton(new List <IButton> { gameController.LeftDpad, pcController.LeftDpad, pcAltController.LeftDpad, }); _rightActionDPad = new MultiButton(new List <IButton> { gameController.RightDpad, pcController.RightDpad, pcAltController.RightDpad, }); _upDpad = new MultiButton(new List <IButton> { pcController.UpDpad, pcAltController.UpDpad, }); _downDPad = new MultiButton(new List <IButton> { pcController.DownDpad, pcAltController.DownDpad, }); _leftDPad = new MultiButton(new List <IButton> { pcController.LeftDpad, pcAltController.LeftDpad, }); _rightDPad = new MultiButton(new List <IButton> { pcController.RightDpad, pcAltController.RightDpad, }); _a = new MultiButton(new List <IButton> { gameController.A, pcController.A, pcAltController.A, }); _b = new MultiButton(new List <IButton> { gameController.B, pcController.B, pcAltController.B, }); _x = new MultiButton(new List <IButton> { gameController.X, pcController.X, pcAltController.X, }); _y = new MultiButton(new List <IButton> { gameController.Y, pcController.Y, pcAltController.Y, }); _r = new MultiButton(new List <IButton> { gameController.R, pcController.R, pcAltController.R, }); _l = new MultiButton(new List <IButton> { gameController.L, pcController.L, pcAltController.L, }); _r2 = new MultiButton(new List <IButton> { gameController.R2, pcController.R2, pcAltController.R2, }); _l2 = new MultiButton(new List <IButton> { gameController.L2, pcController.L2, pcAltController.L2, }); _joyClickLeft = new MultiButton(new List <IButton> { gameController.JoyClickLeft, pcController.JoyClickLeft, pcAltController.JoyClickLeft, }); _joyClickRight = new MultiButton(new List <IButton> { gameController.JoyClickRight, pcController.JoyClickRight, pcAltController.JoyClickRight, }); _start = new MultiButton(new List <IButton> { gameController.Start, pcController.Start, pcAltController.Start, }); _select = new MultiButton(new List <IButton> { gameController.Select, pcController.Select, pcAltController.Select, }); ControllerData globalControllerData = new ControllerData { upDpad = _upActionDpad, downDpad = _downActionDPad, leftDpad = _leftActionDPad, rightDpad = _rightActionDPad, a = _a, b = _b, x = _x, y = _y, l = _l, r = _r, l2 = _l2, r2 = _r2, jClickLeft = _joyClickLeft, jClickRight = _joyClickRight, start = _start, select = _select, controllerIndex = 0, name = _name }; _xAxisLeftPasser = new CombinedAxis(PcAltController.LeftStick, PcController.LeftStick, GameController.LeftStick, Cardinal.X); _yAxisLeftPasser = new CombinedAxis(PcAltController.LeftStick, PcController.LeftStick, GameController.LeftStick, Cardinal.Y); _xAxisRightPasser = new CombinedAxis(PcAltController.RightStick, PcController.RightStick, GameController.RightStick, Cardinal.X); _yAxisRightPasser = new CombinedAxis(PcAltController.RightStick, PcController.RightStick, GameController.RightStick, Cardinal.Y); InitControllerFromData(globalControllerData); }
public Controller(ControllerData data) { InitControllerFromData(data); }