voxelman/level_generator/voxelman_level_generator.cpp

25 lines
730 B
C++
Raw Normal View History

2019-09-03 13:52:32 +02:00
#include "voxelman_level_generator.h"
2019-11-19 16:33:06 +01:00
#include "../world/voxel_chunk.h"
2019-11-19 14:42:21 +01:00
void VoxelmanLevelGenerator::generate_chunk_bind(Node *chunk) {
2020-01-09 04:29:05 +01:00
generate_chunk(Object::cast_to<VoxelChunk>(chunk));
2019-11-19 14:42:21 +01:00
}
void VoxelmanLevelGenerator::generate_chunk(VoxelChunk *chunk) {
2020-01-09 04:29:05 +01:00
if (has_method("_generate_chunk")) {
call("_generate_chunk", chunk);
}
2019-11-19 14:42:21 +01:00
}
2019-09-03 13:52:32 +02:00
VoxelmanLevelGenerator::VoxelmanLevelGenerator() {
}
VoxelmanLevelGenerator::~VoxelmanLevelGenerator() {
}
void VoxelmanLevelGenerator::_bind_methods() {
2020-01-09 04:29:05 +01:00
BIND_VMETHOD(MethodInfo("_generate_chunk", PropertyInfo(Variant::OBJECT, "chunk", PROPERTY_HINT_RESOURCE_TYPE, "VoxelChunk")));
2019-11-19 14:42:21 +01:00
2020-01-09 04:29:05 +01:00
ClassDB::bind_method(D_METHOD("generate_chunk", "chunk"), &VoxelmanLevelGenerator::generate_chunk_bind);
2019-09-03 13:52:32 +02:00
}