//
//  UserSettings.swift
//  DashSmash
//
//  Lightweight player-preference store. Lives in UserDefaults so the
//  player's choices persist across launches without needing a more
//  formal settings screen.
//

import Foundation

final class UserSettings {
    static let shared = UserSettings()

    private let defaults: UserDefaults
    private let runnerKey = "DashSmash.useRunnerCharacter.v1"

    private init(defaults: UserDefaults = .standard) {
        self.defaults = defaults
    }

    /// When true, the in-game player is rendered as an animated stick-figure
    /// runner instead of the default white cube. Visuals only — collision
    /// bounds and physics are unchanged.
    var useRunnerCharacter: Bool {
        get { defaults.bool(forKey: runnerKey) }
        set { defaults.set(newValue, forKey: runnerKey) }
    }
}
