@tool
extends Marker2D

@onready var number = $Number
@onready var number_label = $Number/Label

@export_range(0, 12, 1, "o'clock") var part : float:
	set(value):
		part = value
		set_part(part)

@export var value : int:
	set(new_value):
		value = new_value
		await ready
		set_value(value)

var _part: float
var _value: int

func _process(delta):
	number.rotation = -rotation

func set_part(value):
	_part = value
	var new_rotation = 2*PI * value / 12
	rotation = new_rotation

func get_part():
	return _part

func set_value(new_value):
	_value = new_value
	number_label.text = str(new_value)

func get_value():
	return _value

func get_number_position():
	return number.global_position
