2019-09-24 02:42:42 +02:00
|
|
|
#include "biome.h"
|
2019-09-22 22:12:20 +02:00
|
|
|
|
2019-09-24 02:42:42 +02:00
|
|
|
void Biome::generate_chunk(Ref<VoxelChunk> chunk) {
|
|
|
|
if (has_method("_generate")) {
|
|
|
|
call("_generate", chunk);
|
|
|
|
}
|
2019-09-22 22:12:20 +02:00
|
|
|
}
|
2019-09-24 02:42:42 +02:00
|
|
|
void Biome::generate_stack(Ref<VoxelChunk> chunk, int x, int z) {
|
|
|
|
if (has_method("_generate")) {
|
|
|
|
call("_generate", chunk, x, z);
|
|
|
|
}
|
2019-09-22 22:12:20 +02:00
|
|
|
}
|
|
|
|
|
2019-09-24 02:42:42 +02:00
|
|
|
Biome::Biome() {
|
2019-09-22 22:12:20 +02:00
|
|
|
|
|
|
|
}
|
2019-09-24 02:42:42 +02:00
|
|
|
Biome::~Biome() {
|
2019-09-22 22:12:20 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-09-24 02:42:42 +02:00
|
|
|
void Biome::_bind_methods() {
|
|
|
|
BIND_VMETHOD(MethodInfo("_generate_chunk", PropertyInfo(Variant::OBJECT, "structure", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk")));
|
|
|
|
BIND_VMETHOD(MethodInfo("_generate_stack", PropertyInfo(Variant::OBJECT, "structure", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk"), PropertyInfo(Variant::INT, "x"), PropertyInfo(Variant::INT, "z")));
|
|
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("generate_chunk", "chunk"), &Biome::generate_chunk);
|
|
|
|
ClassDB::bind_method(D_METHOD("generate_stack", "chunk", "x", "z"), &Biome::generate_stack);
|
2019-09-22 22:12:20 +02:00
|
|
|
}
|