feat: add deterministic goat routine
This commit is contained in:
@@ -74,6 +74,32 @@ func get_animal_candidates(action_id: StringName) -> Array[Dictionary]:
|
||||
}
|
||||
)
|
||||
)
|
||||
candidates.sort_custom(
|
||||
func(first: Dictionary, second: Dictionary) -> bool:
|
||||
return String(first["target_id"]) < String(second["target_id"])
|
||||
)
|
||||
return candidates
|
||||
|
||||
|
||||
func get_animal_routine_sites(species_id: StringName) -> Array[Dictionary]:
|
||||
var candidates: Array[Dictionary] = []
|
||||
for site in AnimalRoutineSite.get_all():
|
||||
if not site.supports_species(species_id):
|
||||
continue
|
||||
(
|
||||
candidates
|
||||
. append(
|
||||
{
|
||||
"site_id": String(site.site_id),
|
||||
"position": site.get_routine_position(),
|
||||
"display_name": site.display_name,
|
||||
}
|
||||
)
|
||||
)
|
||||
candidates.sort_custom(
|
||||
func(first: Dictionary, second: Dictionary) -> bool:
|
||||
return String(first["site_id"]) < String(second["site_id"])
|
||||
)
|
||||
return candidates
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user