44 lines
944 B
C++
44 lines
944 B
C++
#ifndef ENEMY_SPAWNER_H
|
|
#define ENEMY_SPAWNER_H
|
|
|
|
#include "core/io/resource.h"
|
|
#include "core/templates/hash_map.h"
|
|
#include "scene/3d/node_3d.h"
|
|
class MapRegion;
|
|
class PatrolPath;
|
|
|
|
class SpawnData : public Resource {
|
|
GDCLASS(SpawnData, Resource);
|
|
static void _bind_methods();
|
|
|
|
public:
|
|
void set_difficulty_spawns(Dictionary dict);
|
|
Dictionary get_difficulty_spawns() const;
|
|
|
|
public:
|
|
HashMap<int, Ref<PackedScene>> difficulty_spawns{};
|
|
};
|
|
|
|
class EnemySpawner : public Node3D {
|
|
GDCLASS(EnemySpawner, Node3D);
|
|
static void _bind_methods();
|
|
void on_phase_change(bool hunt);
|
|
void ready();
|
|
|
|
protected:
|
|
void _notification(int what);
|
|
|
|
public:
|
|
void set_spawn_data(Ref<SpawnData> data);
|
|
Ref<SpawnData> get_spawn_data() const;
|
|
void set_patrol_path(PatrolPath *path);
|
|
PatrolPath *get_patrol_path() const;
|
|
|
|
private:
|
|
Ref<SpawnData> spawn_data{};
|
|
PatrolPath *patrol_path{ nullptr };
|
|
MapRegion *region{ nullptr };
|
|
};
|
|
|
|
#endif // !ENEMY_SPAWNER_H
|