2020-01-29 05:56:10 +01:00
|
|
|
# Base type for group-based steering behaviors.
|
2020-04-03 02:31:59 +02:00
|
|
|
# @category - Base types
|
2020-02-11 18:33:25 +01:00
|
|
|
class_name GSAIGroupBehavior
|
|
|
|
extends GSAISteeringBehavior
|
2020-01-10 18:15:50 +01:00
|
|
|
|
2020-01-29 05:56:10 +01:00
|
|
|
# Container to find neighbors of the agent and calculate group behavior.
|
2020-02-11 18:33:25 +01:00
|
|
|
var proximity: GSAIProximity
|
2020-01-10 18:15:50 +01:00
|
|
|
|
2020-01-29 22:53:57 +01:00
|
|
|
var _callback := funcref(self, "_report_neighbor")
|
2020-01-10 18:15:50 +01:00
|
|
|
|
|
|
|
|
2020-02-11 20:36:06 +01:00
|
|
|
func _init(agent: GSAISteeringAgent, _proximity: GSAIProximity).(agent) -> void:
|
|
|
|
self.proximity = _proximity
|
2020-01-10 18:15:50 +01:00
|
|
|
|
|
|
|
|
2020-01-28 00:31:10 +01:00
|
|
|
# Internal callback for the behavior to define whether or not a member is
|
|
|
|
# relevant
|
2020-04-03 02:31:59 +02:00
|
|
|
# @tags - virtual
|
2020-02-11 20:18:22 +01:00
|
|
|
func _report_neighbor(_neighbor: GSAISteeringAgent) -> bool:
|
2020-01-10 18:15:50 +01:00
|
|
|
return false
|