refactor: move resource authority into simulation

This commit is contained in:
2026-07-05 13:26:19 +02:00
parent f83d2c7704
commit 363620b731
10 changed files with 480 additions and 174 deletions
+8 -2
View File
@@ -74,11 +74,17 @@ func try_interact() -> void:
print("Player ate food from the village supply.")
func try_harvest_resource_node() -> bool:
var node := ResourceNode.find_nearest_for_player(global_position, interaction_range)
if not simulation_manager.has_method("find_resource_node_for_player"):
push_error("Player: SimulationManager cannot find ResourceNodes")
return false
var node: ResourceNode = simulation_manager.find_resource_node_for_player(
global_position,
interaction_range
)
if node == null:
return false
if not node.enabled:
if not node.is_enabled():
print("%s is unavailable." % node.node_id)
return true