feat(character): add outfit layer API (set/clear/get_outfit per layer 1-3)

This commit is contained in:
Steven Wroblewski
2026-05-08 22:07:53 +02:00
parent 9be67c8dfe
commit 1a9d916293
2 changed files with 81 additions and 0 deletions
+39
View File
@@ -73,3 +73,42 @@ func test_set_animation_state_happy() -> void:
func test_set_animation_state_sleeping() -> void:
_char.set_animation_state("sleeping")
assert_eq(_char.get_animation_state(), "sleeping")
func test_get_outfit_returns_empty_for_all_layers_initially() -> void:
assert_eq(_char.get_outfit(1), "")
assert_eq(_char.get_outfit(2), "")
assert_eq(_char.get_outfit(3), "")
func test_set_outfit_stores_item_id() -> void:
_char.set_outfit(1, "white_coat", null)
assert_eq(_char.get_outfit(1), "white_coat")
func test_set_outfit_does_not_affect_other_layers() -> void:
_char.set_outfit(1, "white_coat", null)
assert_eq(_char.get_outfit(2), "")
assert_eq(_char.get_outfit(3), "")
func test_clear_outfit_returns_item_id() -> void:
_char.set_outfit(2, "cast_arm", null)
var returned: String = _char.clear_outfit(2)
assert_eq(returned, "cast_arm")
func test_clear_outfit_empties_layer() -> void:
_char.set_outfit(2, "cast_arm", null)
_char.clear_outfit(2)
assert_eq(_char.get_outfit(2), "")
func test_set_outfit_invalid_layer_zero_is_noop() -> void:
_char.set_outfit(0, "white_coat", null)
assert_eq(_char.get_outfit(1), "")
func test_set_outfit_invalid_layer_four_is_noop() -> void:
_char.set_outfit(4, "white_coat", null)
assert_eq(_char.get_outfit(3), "")