public GamepadOpenTk( GamePadCapabilities capabilities, IButtonManager buttonManager) { this.AnalogSticks = new IAnalogStick[] { this.primaryAnalogStick_, this.secondaryAnalogStick_ } .ToImmutableArray(); this.primaryButton_ = buttonManager.New(); this.secondaryButton_ = buttonManager.New(); this.Buttons = new IButton[] { this.primaryButton_, this.secondaryButton_ } .ToImmutableArray(); }
public JoystickOpenTk( JoystickCapabilities capabilities, IButtonManager buttonManager) { this.axes_ = new MutableAxis[capabilities.AxisCount]; for (var i = 0; i < this.axes_.Length; ++i) { this.axes_[i] = new MutableAxis(); } this.Axes = this.axes_.ToImmutableArray <IAxis>(); this.buttons_ = new IButtonImplementation[capabilities.ButtonCount]; for (var i = 0; i < this.buttons_.Length; ++i) { this.buttons_[i] = buttonManager.New(); } this.Buttons = this.buttons_.ToImmutableArray <IButton>(); }