feat: defining map region unit un-/registering behaviour
This commit is contained in:
parent
92c38e54b6
commit
d8ae45df0f
7 changed files with 87 additions and 1 deletions
|
|
@ -1,15 +1,27 @@
|
|||
#ifndef MAP_REGION_H
|
||||
#define MAP_REGION_H
|
||||
|
||||
#include "core/templates/hash_set.h"
|
||||
#include "npc_unit.h"
|
||||
#include "scene/3d/physics/area_3d.h"
|
||||
|
||||
class MapRegion : public Area3D {
|
||||
GDCLASS(MapRegion, Area3D);
|
||||
static void _bind_methods();
|
||||
void on_node_entered(Node *node);
|
||||
void ready();
|
||||
|
||||
protected:
|
||||
void _notification(int what);
|
||||
|
||||
public:
|
||||
void register_unit(NpcUnit *unit);
|
||||
void remove_unit(NpcUnit *unit);
|
||||
|
||||
private:
|
||||
float awareness{ 0.f };
|
||||
bool hunt_phase{ false };
|
||||
HashSet<NpcUnit *> units{ nullptr };
|
||||
|
||||
public:
|
||||
static String const sig_phase_changed;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue