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:
@@ -1,11 +1,9 @@
|
||||
class_name ActionTargetResolver
|
||||
extends RefCounted
|
||||
|
||||
|
||||
func resolve(
|
||||
npc: SimNPC,
|
||||
origin: Vector3,
|
||||
simulation_manager: Node,
|
||||
active_world_adapter: Node
|
||||
npc: SimNPC, origin: Vector3, simulation_manager: Node, active_world_adapter: Node
|
||||
) -> Dictionary:
|
||||
var definition := SimulationDefinitions.get_action(npc.current_task)
|
||||
if definition == null:
|
||||
@@ -13,18 +11,17 @@ func resolve(
|
||||
match definition.target_type:
|
||||
SimulationIds.TARGET_RESOURCE:
|
||||
return _resolve_resource(
|
||||
npc, origin, definition, simulation_manager,
|
||||
active_world_adapter
|
||||
npc, origin, definition, simulation_manager, active_world_adapter
|
||||
)
|
||||
SimulationIds.TARGET_ACTIVITY:
|
||||
return active_world_adapter.get_activity_target(npc.current_task)
|
||||
SimulationIds.TARGET_FREE:
|
||||
return {
|
||||
"target_id": "",
|
||||
"position": origin + simulation_manager.get_wander_offset(npc.id)
|
||||
"target_id": "", "position": origin + simulation_manager.get_wander_offset(npc.id)
|
||||
}
|
||||
return {}
|
||||
|
||||
|
||||
func _resolve_resource(
|
||||
npc: SimNPC,
|
||||
origin: Vector3,
|
||||
@@ -34,18 +31,10 @@ func _resolve_resource(
|
||||
) -> Dictionary:
|
||||
var best: Dictionary = {}
|
||||
var best_distance := INF
|
||||
for candidate in active_world_adapter.get_resource_candidates(
|
||||
definition.resource_action_id
|
||||
):
|
||||
for candidate in active_world_adapter.get_resource_candidates(definition.resource_action_id):
|
||||
var node_id := StringName(candidate["target_id"])
|
||||
var state: ResourceStateRecord = simulation_manager.get_resource_state(
|
||||
node_id
|
||||
)
|
||||
if (
|
||||
state == null
|
||||
or not state.can_npc_use()
|
||||
or not state.is_available_for(npc.id)
|
||||
):
|
||||
var state: ResourceStateRecord = simulation_manager.get_resource_state(node_id)
|
||||
if state == null or not state.can_npc_use() or not state.is_available_for(npc.id):
|
||||
continue
|
||||
var position: Vector3 = candidate["position"]
|
||||
var distance := origin.distance_squared_to(position)
|
||||
|
||||
Reference in New Issue
Block a user