class_name UnitAppearance extends Resource

@export var default_appearance_key: String = "default"
@export var current_appearance_key: String
@export var appearance_sets: Dictionary[String, UnitAppearanceSet]
	
var deployed_sprite_sheet: SpriteFrames:
	get:
		var key: String = current_appearance_key
		if(key == null or key == ""):
			key = default_appearance_key
		if(!appearance_sets.has(key)):
			return null
		var appearance_set: UnitAppearanceSet = appearance_sets[key]
		var sprite_value = appearance_set.deployed_sprite_sheet
		if(sprite_value == null):
			sprite_value = appearance_sets[default_appearance_key].deployed_sprite_sheet
		
		return sprite_value
