38 lines
834 B
C++
38 lines
834 B
C++
#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(Node3D *node);
|
|
void on_node_exited(Node3D *node);
|
|
void on_child_entered_tree(Node *node);
|
|
void enter_tree();
|
|
void ready();
|
|
|
|
protected:
|
|
void _notification(int what);
|
|
|
|
public:
|
|
void register_unit(NpcUnit *unit);
|
|
void remove_unit(NpcUnit *unit);
|
|
void raise_difficulty(double amount);
|
|
int get_current_difficulty() const;
|
|
|
|
private:
|
|
double difficulty{ 0.f };
|
|
bool hunt_phase{ false };
|
|
HashSet<NpcUnit *> units{ nullptr };
|
|
bool has_player{ false };
|
|
|
|
public:
|
|
static String const sig_difficulty_increased;
|
|
static String const sig_phase_changed;
|
|
};
|
|
|
|
#endif // !MAP_REGION_H
|