Yattee v2 rewrite

This commit is contained in:
Arkadiusz Fal
2026-02-08 18:31:16 +01:00
parent 20d0cfc0c7
commit 05f921d605
1043 changed files with 163875 additions and 68430 deletions

View File

@@ -0,0 +1,42 @@
//
// TapZoneConfiguration.swift
// Yattee
//
// Configuration for a single tap zone's action.
//
import Foundation
/// Configuration for a tap zone, mapping a position to an action.
struct TapZoneConfiguration: Codable, Hashable, Sendable, Identifiable {
/// Unique identifier for this configuration.
var id: UUID
/// The position of this zone within the layout.
var position: TapZonePosition
/// The action to perform when this zone is double-tapped.
var action: TapGestureAction
/// Creates a new tap zone configuration.
/// - Parameters:
/// - id: Unique identifier (defaults to new UUID).
/// - position: Zone position.
/// - action: Action to perform.
init(
id: UUID = UUID(),
position: TapZonePosition,
action: TapGestureAction
) {
self.id = id
self.position = position
self.action = action
}
/// Creates a configuration with a new action, preserving the ID.
/// - Parameter newAction: The new action.
/// - Returns: Updated configuration.
func withAction(_ newAction: TapGestureAction) -> TapZoneConfiguration {
TapZoneConfiguration(id: id, position: position, action: newAction)
}
}