class_name PlayerSpecs
extends Resource

@export var sprite_number: int = 0
@export var max_speed_level: Spec.Level = Spec.Level.MEDIUM
@export var acceleration_level: Spec.Level = Spec.Level.MEDIUM
@export var brake_level: Spec.Level = Spec.Level.MEDIUM
@export var control_level: Spec.Level = Spec.Level.MEDIUM

var _max_speed: float = 0.0
var _acceleration: float = 0.0
var _brake: float = 0.0
var _control: float = 0.0


func get_max_speed() -> float:
	if not _max_speed:
		_max_speed = Spec.SPECS[Spec.Type.MAX_SPEED][max_speed_level]
	return _max_speed


func get_acceleration() -> float:
	if not _acceleration:
		_acceleration = Spec.SPECS[Spec.Type.ACCELERATION][acceleration_level]
	return _acceleration


func get_brake_deceleration() -> float:
	if not _brake:
		_brake = Spec.SPECS[Spec.Type.BRAKE_DECELERATION][brake_level]
	return _brake


func get_control() -> float:
	if not _control:
		_control = Spec.SPECS[Spec.Type.CONTROL][control_level]
	return _control
