Skip to content

Commit e0a5c13

Browse files
committed
Eliminate lazy load
1 parent 7414f38 commit e0a5c13

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

Sources/GateEngine/System/HID/GamePad/GamePadInterpreter/Interpreters/HID/IOKitGamePadInterpreter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private class HIDController {
2929
}
3030
}
3131
internal final class IOKitGamePadInterpreter: GamePadInterpreter {
32-
let hid: HID = Game.shared.hid
32+
var hid: HID { Game.shared.hid }
3333
init?() {}
3434

3535
nonisolated static let sdlDatabase = try! SDL2Database()

Sources/GateEngine/System/HID/GamePad/GamePadInterpreter/Interpreters/HID/LinuxHIDGamePadInterpreter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ private func test_bit(_ bit: Int, _ array: [UInt32]) -> Bool {
3838
}
3939

4040
internal final class LinuxHIDGamePadInterpreter: GamePadInterpreter {
41-
let hid: HID = Game.shared.hid
41+
var hid: HID { Game.shared.hid }
4242
let sdl2Database: SDL2Database
4343
required init() {
4444
self.sdl2Database = try! SDL2Database()

Sources/GateEngine/System/HID/GamePad/GamePadInterpreter/Interpreters/MFIGamePadInterpreter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import GameController
99

1010
internal final class MFIGamePadInterpreter: GamePadInterpreter {
11-
let hid: HID = Game.shared.hid
11+
var hid: HID { Game.shared.hid }
1212
init?() {
1313
guard Self.isSupported else { return nil }
1414
if #available(macOS 11.3, macCatalyst 14.5, iOS 14.5, tvOS 14.5, *) {

Sources/GateEngine/System/HID/GamePad/GamePadInterpreter/Interpreters/NullGamePadInterpreter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
internal final class NullGamePadInterpreter: GamePadInterpreter {
9-
let hid: HID = Game.shared.hid
9+
var hid: HID { Game.shared.hid }
1010
init() {}
1111
func beginInterpreting() {}
1212
func update() {}

Sources/GateEngine/System/HID/GamePad/GamePadInterpreter/Interpreters/WASIGamePadInterpreter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import DOM
1111
import Gamepad
1212

1313
internal final class WASIGamePadInterpreter: GamePadInterpreter {
14-
let hid: HID = Game.shared.hid
14+
var hid: HID { Game.shared.hid }
1515
var wGamepads: [Gamepad] = []
1616
init() {}
1717

Sources/GateEngine/System/HID/GamePad/GamePadInterpreter/Interpreters/XInputGamePadInterpreter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import WinSDK.DirectX.XInput14
99

1010
internal final class XInputGamePadInterpreter: GamePadInterpreter {
11-
let hid: HID = Game.shared.hid
11+
var hid: HID { Game.shared.hid }
1212
init() {}
1313

1414
func beginInterpreting() {

Sources/GateEngine/System/HID/HID.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public enum InputMethod {
3535
public let mouse: Mouse = Mouse()
3636
public let screen: TouchScreen = TouchScreen()
3737
public let surfaces: SurfaceDevices = SurfaceDevices()
38-
public private(set) lazy var gamePads: GamePadManger = GamePadManger()
38+
public let gamePads: GamePadManger = GamePadManger()
3939

4040
/// The most recent input method used by the end user
4141
public private(set) var recentInputMethod: InputMethod = .mouseKeyboard

0 commit comments

Comments
 (0)