2023-01-13 22:04:30 +01:00
|
|
|
#ifndef GSAI_INFINITE_PROXIMITY_H
|
|
|
|
#define GSAI_INFINITE_PROXIMITY_H
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-14 00:28:56 +01:00
|
|
|
#include "core/object/func_ref.h"
|
|
|
|
#include "core/object/reference.h"
|
|
|
|
|
|
|
|
#include "gsai_proximity.h"
|
|
|
|
|
2023-01-13 21:13:57 +01:00
|
|
|
class GSAIInfiniteProximity : public GSAIProximity {
|
2023-01-13 21:35:07 +01:00
|
|
|
GDCLASS(GSAIInfiniteProximity, GSAIProximity);
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-13 21:35:07 +01:00
|
|
|
public:
|
2023-01-14 00:28:56 +01:00
|
|
|
int _find_neighbors(Ref<FuncRef> callback);
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-13 21:35:07 +01:00
|
|
|
GSAIInfiniteProximity();
|
|
|
|
~GSAIInfiniteProximity();
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-13 21:35:07 +01:00
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-13 21:35:07 +01:00
|
|
|
// Determines any agent that is in the specified list as being neighbors with the
|
|
|
|
// owner agent, regardless of distance.
|
|
|
|
// @category - Proximities
|
|
|
|
// 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.
|
|
|
|
// @tags - virtual
|
2023-01-13 21:13:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|