42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
#include <core/os/memory.h>
|
|
#include <core/io/config_file.h>
|
|
class BuildingLayoutGraph {
|
|
static BuildingLayoutGraph *singleton;
|
|
|
|
BuildingLayoutGraph();
|
|
|
|
ConfigFile config;
|
|
Array public_rooms;
|
|
Array private_rooms;
|
|
|
|
flecs::entity create_graph_entity(const String &base_path,
|
|
const String &entity_type);
|
|
|
|
public:
|
|
virtual ~BuildingLayoutGraph();
|
|
static BuildingLayoutGraph *get_singleton()
|
|
{
|
|
if (!singleton)
|
|
singleton = memnew(BuildingLayoutGraph());
|
|
return singleton;
|
|
}
|
|
static void cleanup()
|
|
{
|
|
memdelete(singleton);
|
|
singleton = nullptr;
|
|
}
|
|
void get_room_data(int id, Array &result);
|
|
const Array &get_private_rooms() const;
|
|
const Array &get_public_rooms() const;
|
|
void create_zone(const String &base_path, int zone_type);
|
|
void create_unit(const String &base_path);
|
|
void create_room(const String &base_path, int id);
|
|
void destroy_graph_entity(const String &path);
|
|
flecs::entity get_layout_base() const;
|
|
void get_layout_list(List<String> *keys) const;
|
|
void create_new_layout(const String &layout_name);
|
|
flecs::entity get_layout(const String &layout_name) const;
|
|
void get_layout_entity_children(flecs::entity layout_e,
|
|
List<flecs::entity> *keys) const;
|
|
void recalculate_size(const String &layout_name);
|
|
}; |