class_name JobData
extends Resource

@export var job_name: String
@export var job_reward: float:
	set(value):
		job_reward = value
		_generate_job_time()
@export var job_experience: float:
	set(value):
		job_experience = value
		_generate_job_time()
@export var job_amount: int:
	set(value):
		job_amount = value
		_generate_job_time()

# - Difficulty from 1 to 5: Easy, Medium, Hard, Pain, Torture
@export var job_difficulty: int = 1:
	set(value):
		clamp(value, 1, 5)
		job_difficulty = value
		_generate_job_time()

@export var job_description: String
var job_time: float
var job_material: String = "PLA"


func _init() -> void:
	_generate_job_time()

# Generate printing time 
func _generate_job_time() -> void:
	var print_time: float = sqrt(job_experience + job_reward) * job_amount
	var round_time: float = round(print_time * 100) / 100
	job_time = round_time
