-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPointerConfig.swift
More file actions
42 lines (37 loc) · 1.11 KB
/
Copy pathPointerConfig.swift
File metadata and controls
42 lines (37 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import Foundation
/// Kompatybilność — deleguje do `MotionConfig`.
public struct PointerConfig: Equatable {
/// Tryb sterowania przekazywany do `motion`.
public var mode: MotionMode {
get { motion.mode }
set { motion.mode = newValue }
}
/// Docelowa konfiguracja silnika ruchu.
public var motion: MotionConfig
/// Tworzy konfigurację zgodności dla starszego API wskaźnika.
public init(motion: MotionConfig = MotionConfig()) {
self.motion = motion
}
/// Domyślna konfiguracja zgodności.
public static let `default` = PointerConfig()
/// Preset zgodności dla trybu paletki.
public static let paddleDefaults = PointerConfig(motion: {
var c = MotionConfig()
c.mode = .paddle
return c
}())
/// Preset zgodności dla trybu wskaźnika.
public static let pointerDefaults = PointerConfig(motion: {
var c = MotionConfig()
c.mode = .pointer
return c
}())
}
/// Kierunek wskaźnika wyliczony z osi X/Y.
public enum PointerDirection: String, Sendable {
case left = "LEFT"
case right = "RIGHT"
case up = "UP"
case down = "DOWN"
case center = "CENTER"
}