godot-steering-ai-framework/project/src/Proximities/GSTProximity.gd
Nathan Lovato 0586878fcf Fix the style of booleans and virtual functions in the API
Made booleans start with a prefix, e.g. is_open
Added a leading underscore to two virtual functions
Added VIRTUAL comment above several virtual functions
Renamed accel -> acceleration in a function
2020-01-29 15:53:57 -06:00

23 lines
658 B
GDScript

# Base container type that stores data to find the neighbors of an agent.
extends Reference
class_name GSTProximity
# The owning agent whose neighbors are found in the group
var agent: GSTSteeringAgent
# The agents who are part of this group and could be potential neighbors
var agents := []
func _init(agent: GSTSteeringAgent, agents: Array) -> void:
self.agent = agent
self.agents = agents
# Returns a number of neighbors based on a `callback` function.
#
# `_find_neighbors` calls `callback` for each agent in the `agents` array and
# adds one to the count if its `callback` returns true.
func _find_neighbors(callback: FuncRef) -> int:
return 0