From ec43b9ff850c2a9e684591c407824fa95ebbf025 Mon Sep 17 00:00:00 2001 From: thefiddler Date: Thu, 2 Jan 2014 19:27:04 +0100 Subject: [PATCH] [Input] GamePad and Joystick classes should be sealed --- Source/OpenTK/Input/GamePad.cs | 4 +++- Source/OpenTK/Input/Joystick.cs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/OpenTK/Input/GamePad.cs b/Source/OpenTK/Input/GamePad.cs index a0a63f49..8f8468d1 100644 --- a/Source/OpenTK/Input/GamePad.cs +++ b/Source/OpenTK/Input/GamePad.cs @@ -32,7 +32,7 @@ namespace OpenTK.Input /// /// Provides access to GamePad devices. /// - public class GamePad + public sealed class GamePad { internal const int MaxAxisCount = 10; internal const int MaxDPadCount = 2; @@ -40,6 +40,8 @@ namespace OpenTK.Input static readonly IGamePadDriver driver = Platform.Factory.Default.CreateGamePadDriver(); + private GamePad() { } + /// /// Retrieves a GamePadCapabilities structure describing the /// capabilities of a gamepad device. diff --git a/Source/OpenTK/Input/Joystick.cs b/Source/OpenTK/Input/Joystick.cs index 2b10cfb9..7f1037e1 100644 --- a/Source/OpenTK/Input/Joystick.cs +++ b/Source/OpenTK/Input/Joystick.cs @@ -33,11 +33,13 @@ using System.Text; namespace OpenTK.Input { - public class Joystick + public sealed class Joystick { static readonly IJoystickDriver2 implementation = Platform.Factory.Default.CreateJoystickDriver(); + private Joystick() { } + public static JoystickCapabilities GetCapabilities(int index) { return implementation.GetCapabilities(index);