2023-01-13 22:04:30 +01:00
|
|
|
#ifndef GSAI_PRIORITY_H
|
|
|
|
#define GSAI_PRIORITY_H
|
2023-01-13 21:13:57 +01:00
|
|
|
|
2023-01-14 01:43:20 +01:00
|
|
|
#include "core/object/reference.h"
|
|
|
|
|
|
|
|
#include "../gsai_steering_behavior.h"
|
|
|
|
|
|
|
|
class GSAISteeringBehavior;
|
|
|
|
class GSAITargetAcceleration;
|
|
|
|
|
2023-01-13 21:13:57 +01:00
|
|
|
class GSAIPriority : public GSAISteeringBehavior {
|
2023-01-13 21:35:07 +01:00
|
|
|
GDCLASS(GSAIPriority, GSAISteeringBehavior);
|
|
|
|
|
|
|
|
public:
|
|
|
|
float get_zero_threshold() const;
|
|
|
|
void set_zero_threshold(const float val);
|
|
|
|
|
2023-01-14 01:43:20 +01:00
|
|
|
void add_behavior(const Ref<GSAISteeringBehavior> &behavior);
|
|
|
|
Ref<GSAISteeringBehavior> get_behavior(const int index);
|
2023-01-13 21:35:07 +01:00
|
|
|
void remove_behavior(const int index);
|
|
|
|
int get_behaviour_count();
|
2023-01-14 01:43:20 +01:00
|
|
|
|
|
|
|
void _calculate_steering(Ref<GSAITargetAcceleration> accel);
|
2023-01-13 21:35:07 +01:00
|
|
|
|
|
|
|
GSAIPriority();
|
|
|
|
~GSAIPriority();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
2023-01-14 01:43:20 +01:00
|
|
|
float zero_threshold;
|
|
|
|
int _last_selected_index;
|
|
|
|
Vector<Ref<GSAISteeringBehavior>> _behaviors;
|
2023-01-13 21:13:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|