class_name PlayerMovementCapabilities
extends RefCounted

## Immutable local-player movement capability selection.
## Unknown or missing profile identifiers collapse to the safe Blizzlike335
## capability set; only RenderSandbox enables debug sprint and free flight.

const BLIZZLIKE_335_PROFILE_ID: StringName = &"Blizzlike335"
const RENDER_SANDBOX_PROFILE_ID: StringName = &"RenderSandbox"

var profile_id: StringName:
	get:
		return _profile_id

var allows_debug_sprint: bool:
	get:
		return _allows_debug_sprint

var allows_debug_free_flight: bool:
	get:
		return _allows_debug_free_flight

var _profile_id: StringName
var _allows_debug_sprint: bool
var _allows_debug_free_flight: bool


func _init(requested_profile_id: StringName = BLIZZLIKE_335_PROFILE_ID) -> void:
	if requested_profile_id == RENDER_SANDBOX_PROFILE_ID:
		_profile_id = RENDER_SANDBOX_PROFILE_ID
		_allows_debug_sprint = true
		_allows_debug_free_flight = true
		return
	_profile_id = BLIZZLIKE_335_PROFILE_ID
	_allows_debug_sprint = false
	_allows_debug_free_flight = false


## Returns the debug-enabled capability set used by current renderer scenes.
static func render_sandbox() -> PlayerMovementCapabilities:
	return PlayerMovementCapabilities.new(RENDER_SANDBOX_PROFILE_ID)


## Returns the compatibility-safe capability set with debug movement disabled.
## This name identifies the intended compatibility profile, not proven 1:1 movement.
static func blizzlike_335() -> PlayerMovementCapabilities:
	return PlayerMovementCapabilities.new(BLIZZLIKE_335_PROFILE_ID)


## Maps scene/application profile configuration to a known capability set.
## Unknown identifiers fail closed to Blizzlike335.
static func for_profile_id(requested_profile_id: StringName) -> PlayerMovementCapabilities:
	return PlayerMovementCapabilities.new(requested_profile_id)
