style: apply gdformat formatting across the entire project
Auto-format all GDScript files using gdformat from gdtoolkit. This is a baseline formatting pass to ensure consistent style: - Normalizes indentation and spacing - Wraps long lines to 100 characters - Removes trailing whitespace - Standardizes blank lines between functions 68 files reformatted, 8 files left unchanged (3rd-party addon files with parse errors excluded).
This commit is contained in:
@@ -2,9 +2,11 @@ extends SceneTree
|
||||
|
||||
var failures: Array[String] = []
|
||||
|
||||
|
||||
func _initialize() -> void:
|
||||
call_deferred("_run")
|
||||
|
||||
|
||||
func _run() -> void:
|
||||
var main_scene: Node = load("res://main.tscn").instantiate()
|
||||
root.add_child(main_scene)
|
||||
@@ -21,25 +23,13 @@ func _run() -> void:
|
||||
var carried_food: MeshInstance3D = visual.get_node("CarriedFood")
|
||||
_check(not carried_food.visible, "NPC should begin without a carried-food prop")
|
||||
npc.add_inventory(SimulationIds.RESOURCE_FOOD, 1.0)
|
||||
manager.emit_signal(
|
||||
"npc_inventory_changed",
|
||||
npc,
|
||||
SimulationIds.RESOURCE_FOOD,
|
||||
1.0
|
||||
)
|
||||
manager.emit_signal("npc_inventory_changed", npc, SimulationIds.RESOURCE_FOOD, 1.0)
|
||||
_check(carried_food.visible, "Carried food should be visible on the NPC")
|
||||
npc.remove_inventory(SimulationIds.RESOURCE_FOOD, 1.0)
|
||||
manager.emit_signal(
|
||||
"npc_inventory_changed",
|
||||
npc,
|
||||
SimulationIds.RESOURCE_FOOD,
|
||||
0.0
|
||||
)
|
||||
manager.emit_signal("npc_inventory_changed", npc, SimulationIds.RESOURCE_FOOD, 0.0)
|
||||
_check(not carried_food.visible, "Deposited or eaten food should be hidden")
|
||||
|
||||
var resource_state: ResourceStateRecord = manager.get_resource_state(
|
||||
&"berry_bush_01"
|
||||
)
|
||||
var resource_state: ResourceStateRecord = manager.get_resource_state(&"berry_bush_01")
|
||||
npc.set_task(SimulationIds.ACTION_GATHER_FOOD)
|
||||
npc.target_id = resource_state.get_node_id()
|
||||
npc.travel_target_position = Vector3(-6.0, 0.0, -8.0)
|
||||
@@ -60,9 +50,11 @@ func _run() -> void:
|
||||
"Unload should synchronize the last active position"
|
||||
)
|
||||
_check(
|
||||
npc.current_task == saved_action
|
||||
and npc.target_id == saved_target_id
|
||||
and npc.travel_target_position.is_equal_approx(saved_target_position),
|
||||
(
|
||||
npc.current_task == saved_action
|
||||
and npc.target_id == saved_target_id
|
||||
and npc.travel_target_position.is_equal_approx(saved_target_position)
|
||||
),
|
||||
"Unload should preserve action and target state"
|
||||
)
|
||||
_check(
|
||||
@@ -87,10 +79,7 @@ func _run() -> void:
|
||||
manager.get_state_checksum() == unloaded_checksum,
|
||||
"Loading a visual must not mutate simulation state"
|
||||
)
|
||||
_check(
|
||||
resource_state.get_reserved_by() == npc.id,
|
||||
"Reload should preserve the reservation"
|
||||
)
|
||||
_check(resource_state.get_reserved_by() == npc.id, "Reload should preserve the reservation")
|
||||
|
||||
var moved_position := authoritative_position + Vector3(0.5, 0.0, 0.25)
|
||||
reloaded.emit_signal("position_changed", npc.id, moved_position)
|
||||
@@ -124,6 +113,7 @@ func _run() -> void:
|
||||
push_error("[TEST] " + failure)
|
||||
quit(1)
|
||||
|
||||
|
||||
func _check(condition: bool, message: String) -> void:
|
||||
if not condition:
|
||||
failures.append(message)
|
||||
|
||||
Reference in New Issue
Block a user