mirror of
https://github.com/Relintai/world_generator.git
synced 2024-11-12 10:15:07 +01:00
Update for Voxelman's changes.
This commit is contained in:
parent
2956e67f60
commit
72fdb52731
@ -87,16 +87,26 @@ int Biome::get_dungeon_count() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Biome::generate_chunk(Ref<VoxelChunk> chunk, bool spawn_mobs) {
|
void Biome::generate_chunk(VoxelChunk *chunk, bool spawn_mobs) {
|
||||||
|
ERR_FAIL_COND(!ObjectDB::instance_validate(chunk));
|
||||||
|
|
||||||
if (has_method("_generate_chunk")) {
|
if (has_method("_generate_chunk")) {
|
||||||
call("_generate_chunk", chunk, spawn_mobs);
|
call("_generate_chunk", chunk, spawn_mobs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Biome::generate_stack(Ref<VoxelChunk> chunk, int x, int z, bool spawn_mobs) {
|
void Biome::generate_chunk_bind(Node *chunk, bool spawn_mobs) {
|
||||||
|
generate_chunk(Object::cast_to<VoxelChunk>(chunk), spawn_mobs);
|
||||||
|
}
|
||||||
|
void Biome::generate_stack(VoxelChunk *chunk, int x, int z, bool spawn_mobs) {
|
||||||
|
ERR_FAIL_COND(!ObjectDB::instance_validate(chunk));
|
||||||
|
|
||||||
if (has_method("_generate_stack")) {
|
if (has_method("_generate_stack")) {
|
||||||
call("_generate_stack", chunk, x, z, spawn_mobs);
|
call("_generate_stack", chunk, x, z, spawn_mobs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void Biome::generate_stack_bind(Node *chunk, int x, int z, bool spawn_mobs) {
|
||||||
|
generate_stack(Object::cast_to<VoxelChunk>(chunk), x, z, spawn_mobs);
|
||||||
|
}
|
||||||
|
|
||||||
Biome::Biome() {
|
Biome::Biome() {
|
||||||
|
|
||||||
@ -109,11 +119,11 @@ Biome::~Biome() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Biome::_bind_methods() {
|
void Biome::_bind_methods() {
|
||||||
BIND_VMETHOD(MethodInfo("_generate_chunk", PropertyInfo(Variant::OBJECT, "structure", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"), PropertyInfo(Variant::BOOL, "spawn_mobs")));
|
BIND_VMETHOD(MethodInfo("_generate_chunk", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"), PropertyInfo(Variant::BOOL, "spawn_mobs")));
|
||||||
BIND_VMETHOD(MethodInfo("_generate_stack", PropertyInfo(Variant::OBJECT, "structure", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"), PropertyInfo(Variant::INT, "x"), PropertyInfo(Variant::INT, "z"), PropertyInfo(Variant::BOOL, "spawn_mobs")));
|
BIND_VMETHOD(MethodInfo("_generate_stack", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"), PropertyInfo(Variant::INT, "x"), PropertyInfo(Variant::INT, "z"), PropertyInfo(Variant::BOOL, "spawn_mobs")));
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("generate_chunk", "chunk", "spawn_mobs"), &Biome::generate_chunk);
|
ClassDB::bind_method(D_METHOD("generate_chunk", "chunk", "spawn_mobs"), &Biome::generate_chunk_bind);
|
||||||
ClassDB::bind_method(D_METHOD("generate_stack", "chunk", "x", "z", "spawn_mobs"), &Biome::generate_stack);
|
ClassDB::bind_method(D_METHOD("generate_stack", "chunk", "x", "z", "spawn_mobs"), &Biome::generate_stack_bind);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_level_range"), &Biome::get_level_range);
|
ClassDB::bind_method(D_METHOD("get_level_range"), &Biome::get_level_range);
|
||||||
ClassDB::bind_method(D_METHOD("set_level_range", "value"), &Biome::set_level_range);
|
ClassDB::bind_method(D_METHOD("set_level_range", "value"), &Biome::set_level_range);
|
||||||
|
@ -44,8 +44,10 @@ public:
|
|||||||
|
|
||||||
int get_dungeon_count() const;
|
int get_dungeon_count() const;
|
||||||
|
|
||||||
void generate_chunk(Ref<VoxelChunk> chunk, bool spawn_mobs);
|
void generate_chunk(VoxelChunk *chunk, bool spawn_mobs);
|
||||||
void generate_stack(Ref<VoxelChunk> chunk, int x, int z, bool spawn_mobs);
|
void generate_chunk_bind(Node *chunk, bool spawn_mobs);
|
||||||
|
void generate_stack(VoxelChunk *chunk, int x, int z, bool spawn_mobs);
|
||||||
|
void generate_stack_bind(Node *chunk, int x, int z, bool spawn_mobs);
|
||||||
|
|
||||||
Biome();
|
Biome();
|
||||||
~Biome();
|
~Biome();
|
||||||
|
@ -199,11 +199,16 @@ void Dungeon::setup() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dungeon::generate_chunk(Ref<VoxelChunk> chunk, bool spawn_mobs) {
|
void Dungeon::generate_chunk(VoxelChunk *chunk, bool spawn_mobs) {
|
||||||
|
ERR_FAIL_COND(!ObjectDB::instance_validate(chunk));
|
||||||
|
|
||||||
if (has_method("_generate_chunk")) {
|
if (has_method("_generate_chunk")) {
|
||||||
call("_generate_chunk", chunk, spawn_mobs);
|
call("_generate_chunk", chunk, spawn_mobs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void Dungeon::generate_chunk_bind(Node *chunk, bool spawn_mobs) {
|
||||||
|
generate_chunk(Object::cast_to<VoxelChunk>(chunk), spawn_mobs);
|
||||||
|
}
|
||||||
|
|
||||||
void Dungeon::generate_structure(Ref<VoxelStructure> structure, bool spawn_mobs) {
|
void Dungeon::generate_structure(Ref<VoxelStructure> structure, bool spawn_mobs) {
|
||||||
if (has_method("_generate_structure")) {
|
if (has_method("_generate_structure")) {
|
||||||
@ -242,10 +247,10 @@ Dungeon::~Dungeon() {
|
|||||||
void Dungeon::_bind_methods() {
|
void Dungeon::_bind_methods() {
|
||||||
BIND_VMETHOD(MethodInfo("_setup"));
|
BIND_VMETHOD(MethodInfo("_setup"));
|
||||||
BIND_VMETHOD(MethodInfo("_generate_structure", PropertyInfo(Variant::OBJECT, "structure", PROPERTY_HINT_RESOURCE_TYPE, "VoxelStructure"), PropertyInfo(Variant::BOOL, "spawn_mobs")));
|
BIND_VMETHOD(MethodInfo("_generate_structure", PropertyInfo(Variant::OBJECT, "structure", PROPERTY_HINT_RESOURCE_TYPE, "VoxelStructure"), PropertyInfo(Variant::BOOL, "spawn_mobs")));
|
||||||
BIND_VMETHOD(MethodInfo("_generate_chunk", PropertyInfo(Variant::OBJECT, "structure", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"), PropertyInfo(Variant::BOOL, "spawn_mobs")));
|
BIND_VMETHOD(MethodInfo("_generate_chunk", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"), PropertyInfo(Variant::BOOL, "spawn_mobs")));
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("setup"), &Dungeon::setup);
|
ClassDB::bind_method(D_METHOD("setup"), &Dungeon::setup);
|
||||||
ClassDB::bind_method(D_METHOD("generate_chunk", "chunk", "spawn_mobs"), &Dungeon::generate_chunk);
|
ClassDB::bind_method(D_METHOD("generate_chunk", "chunk", "spawn_mobs"), &Dungeon::generate_chunk_bind);
|
||||||
ClassDB::bind_method(D_METHOD("generate_structure", "structure", "spawn_mobs"), &Dungeon::generate_structure);
|
ClassDB::bind_method(D_METHOD("generate_structure", "structure", "spawn_mobs"), &Dungeon::generate_structure);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_seed"), &Dungeon::get_seed);
|
ClassDB::bind_method(D_METHOD("get_seed"), &Dungeon::get_seed);
|
||||||
|
@ -91,7 +91,8 @@ public:
|
|||||||
int get_entity_data_count() const;
|
int get_entity_data_count() const;
|
||||||
|
|
||||||
void setup();
|
void setup();
|
||||||
void generate_chunk(Ref<VoxelChunk> chunk, bool spawn_mobs);
|
void generate_chunk(VoxelChunk *chunk, bool spawn_mobs);
|
||||||
|
void generate_chunk_bind(Node *chunk, bool spawn_mobs);
|
||||||
void generate_structure(Ref<VoxelStructure> structure, bool spawn_mobs);
|
void generate_structure(Ref<VoxelStructure> structure, bool spawn_mobs);
|
||||||
|
|
||||||
Ref<Image> generate_map();
|
Ref<Image> generate_map();
|
||||||
|
@ -19,12 +19,6 @@ public:
|
|||||||
|
|
||||||
int get_dungeon_room_count() const;
|
int get_dungeon_room_count() const;
|
||||||
|
|
||||||
void setup();
|
|
||||||
void generate_chunk(Ref<VoxelChunk> chunk, bool spawn_mobs);
|
|
||||||
void generate_structure(Ref<VoxelStructure> structure, bool spawn_mobs);
|
|
||||||
|
|
||||||
Ref<Image> generate_map();
|
|
||||||
|
|
||||||
DungeonCorridor();
|
DungeonCorridor();
|
||||||
~DungeonCorridor();
|
~DungeonCorridor();
|
||||||
|
|
||||||
|
@ -127,12 +127,18 @@ void DungeonRoom::setup() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DungeonRoom::generate_chunk(Ref<VoxelChunk> chunk, bool spawn_mobs) {
|
void DungeonRoom::generate_chunk(VoxelChunk *chunk, bool spawn_mobs) {
|
||||||
|
ERR_FAIL_COND(!ObjectDB::instance_validate(chunk));
|
||||||
|
|
||||||
if (has_method("_generate_chunk")) {
|
if (has_method("_generate_chunk")) {
|
||||||
call("_generate_chunk", chunk, spawn_mobs);
|
call("_generate_chunk", chunk, spawn_mobs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DungeonRoom::generate_chunk_bind(Node *chunk, bool spawn_mobs) {
|
||||||
|
generate_chunk(Object::cast_to<VoxelChunk>(chunk), spawn_mobs);
|
||||||
|
}
|
||||||
|
|
||||||
void DungeonRoom::generate_room(Ref<VoxelStructure> structure, bool spawn_mobs) {
|
void DungeonRoom::generate_room(Ref<VoxelStructure> structure, bool spawn_mobs) {
|
||||||
if (has_method("_generate_room")) {
|
if (has_method("_generate_room")) {
|
||||||
call("_generate_room", structure, spawn_mobs);
|
call("_generate_room", structure, spawn_mobs);
|
||||||
@ -159,10 +165,10 @@ DungeonRoom::~DungeonRoom() {
|
|||||||
void DungeonRoom::_bind_methods() {
|
void DungeonRoom::_bind_methods() {
|
||||||
BIND_VMETHOD(MethodInfo("_setup"));
|
BIND_VMETHOD(MethodInfo("_setup"));
|
||||||
BIND_VMETHOD(MethodInfo("_generate_room", PropertyInfo(Variant::OBJECT, "structure", PROPERTY_HINT_RESOURCE_TYPE, "VoxelStructure"), PropertyInfo(Variant::BOOL, "spawn_mobs")));
|
BIND_VMETHOD(MethodInfo("_generate_room", PropertyInfo(Variant::OBJECT, "structure", PROPERTY_HINT_RESOURCE_TYPE, "VoxelStructure"), PropertyInfo(Variant::BOOL, "spawn_mobs")));
|
||||||
BIND_VMETHOD(MethodInfo("_generate_chunk", PropertyInfo(Variant::OBJECT, "structure", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"), PropertyInfo(Variant::BOOL, "spawn_mobs")));
|
BIND_VMETHOD(MethodInfo("_generate_chunk", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"), PropertyInfo(Variant::BOOL, "spawn_mobs")));
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("setup"), &DungeonRoom::setup);
|
ClassDB::bind_method(D_METHOD("setup"), &DungeonRoom::setup);
|
||||||
ClassDB::bind_method(D_METHOD("generate_chunk", "chunk", "spawn_mobs"), &DungeonRoom::generate_chunk);
|
ClassDB::bind_method(D_METHOD("generate_chunk", "chunk", "spawn_mobs"), &DungeonRoom::generate_chunk_bind);
|
||||||
ClassDB::bind_method(D_METHOD("generate_room", "structure", "spawn_mobs"), &DungeonRoom::generate_room);
|
ClassDB::bind_method(D_METHOD("generate_room", "structure", "spawn_mobs"), &DungeonRoom::generate_room);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_seed"), &DungeonRoom::get_seed);
|
ClassDB::bind_method(D_METHOD("get_seed"), &DungeonRoom::get_seed);
|
||||||
|
@ -65,7 +65,8 @@ public:
|
|||||||
int get_entity_data_count() const;
|
int get_entity_data_count() const;
|
||||||
|
|
||||||
void setup();
|
void setup();
|
||||||
void generate_chunk(Ref<VoxelChunk> chunk, bool spawn_mobs);
|
void generate_chunk(VoxelChunk *chunk, bool spawn_mobs);
|
||||||
|
void generate_chunk_bind(Node *chunk, bool spawn_mobs);
|
||||||
void generate_room(Ref<VoxelStructure> structure, bool spawn_mobs);
|
void generate_room(Ref<VoxelStructure> structure, bool spawn_mobs);
|
||||||
|
|
||||||
DungeonRoom();
|
DungeonRoom();
|
||||||
|
@ -50,12 +50,18 @@ void Planet::setup() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Planet::generate_chunk(Ref<VoxelChunk> chunk, bool spawn_mobs) {
|
void Planet::generate_chunk(VoxelChunk *chunk, bool spawn_mobs) {
|
||||||
|
ERR_FAIL_COND(!ObjectDB::instance_validate(chunk));
|
||||||
|
|
||||||
if (has_method("_generate_chunk")) {
|
if (has_method("_generate_chunk")) {
|
||||||
call("_generate_chunk", chunk, spawn_mobs);
|
call("_generate_chunk", chunk, spawn_mobs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Planet::generate_chunk_bind(Node *chunk, bool spawn_mobs) {
|
||||||
|
generate_chunk(Object::cast_to<VoxelChunk>(chunk), spawn_mobs);
|
||||||
|
}
|
||||||
|
|
||||||
Ref<Image> Planet::generate_map() {
|
Ref<Image> Planet::generate_map() {
|
||||||
ERR_FAIL_COND_V(!has_method("_generate_map"), Ref<Image>());
|
ERR_FAIL_COND_V(!has_method("_generate_map"), Ref<Image>());
|
||||||
|
|
||||||
@ -72,9 +78,9 @@ Planet::~Planet() {
|
|||||||
|
|
||||||
void Planet::_bind_methods() {
|
void Planet::_bind_methods() {
|
||||||
BIND_VMETHOD(MethodInfo("_setup"));
|
BIND_VMETHOD(MethodInfo("_setup"));
|
||||||
BIND_VMETHOD(MethodInfo("_generate_chunk", PropertyInfo(Variant::OBJECT, "structure", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"), PropertyInfo(Variant::BOOL, "spawn_mobs")));
|
BIND_VMETHOD(MethodInfo("_generate_chunk", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"), PropertyInfo(Variant::BOOL, "spawn_mobs")));
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("generate_chunk", "chunk"), &Planet::generate_chunk);
|
ClassDB::bind_method(D_METHOD("generate_chunk", "chunk"), &Planet::generate_chunk_bind);
|
||||||
ClassDB::bind_method(D_METHOD("setup"), &Planet::setup);
|
ClassDB::bind_method(D_METHOD("setup"), &Planet::setup);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_seed"), &Planet::get_seed);
|
ClassDB::bind_method(D_METHOD("get_seed"), &Planet::get_seed);
|
||||||
|
@ -30,7 +30,8 @@ public:
|
|||||||
int get_biome_count() const;
|
int get_biome_count() const;
|
||||||
|
|
||||||
void setup();
|
void setup();
|
||||||
void generate_chunk(Ref<VoxelChunk> chunk, bool spawn_mobs);
|
void generate_chunk(VoxelChunk *chunk, bool spawn_mobs);
|
||||||
|
void generate_chunk_bind(Node *chunk, bool spawn_mobs);
|
||||||
Ref<Image> generate_map();
|
Ref<Image> generate_map();
|
||||||
|
|
||||||
Planet();
|
Planet();
|
||||||
|
Loading…
Reference in New Issue
Block a user