Added level ranges.

This commit is contained in:
Relintai 2019-11-01 15:42:03 +01:00
parent b6b5708003
commit 2956e67f60
16 changed files with 128 additions and 1 deletions

View File

@ -1,5 +1,12 @@
#include "biome_data.h"
Vector2 BiomeData::get_level_range() {
return _level_range;
}
void BiomeData::set_level_range(Vector2 value) {
_level_range = value;
}
Vector2 BiomeData::get_humidity_range() {
return _humidity_range;
}
@ -198,6 +205,10 @@ void BiomeData::_bind_methods() {
ClassDB::bind_method(D_METHOD("setup_biome", "seed"), &BiomeData::setup_biome);
ClassDB::bind_method(D_METHOD("get_level_range"), &BiomeData::get_level_range);
ClassDB::bind_method(D_METHOD("set_level_range", "value"), &BiomeData::set_level_range);
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "level_range"), "set_level_range", "get_level_range");
ClassDB::bind_method(D_METHOD("get_humidity_range"), &BiomeData::get_humidity_range);
ClassDB::bind_method(D_METHOD("set_humidity_range", "value"), &BiomeData::set_humidity_range);
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "humidity_range"), "set_humidity_range", "get_humidity_range");

View File

@ -15,6 +15,9 @@ class BiomeData : public Resource {
GDCLASS(BiomeData, Resource);
public:
Vector2 get_level_range();
void set_level_range(Vector2 value);
Vector2 get_humidity_range();
void set_humidity_range(Vector2 range);
@ -74,9 +77,11 @@ protected:
static void _bind_methods();
private:
Vector2 _level_range;
Vector2 _humidity_range;
Vector2 _temperature_range;
Vector<Ref<DungeonData> > _dungeon_datas;
Vector<Ref<PropData> > _prop_datas;
Vector<Ref<EntityData> > _entity_datas;

View File

@ -1,5 +1,12 @@
#include "dungeon_data.h"
Vector2 DungeonData::get_level_range() {
return _level_range;
}
void DungeonData::set_level_range(Vector2 value) {
_level_range = value;
}
//Min Size
int DungeonData::get_min_sizex() {
return _min_sizex;
@ -335,6 +342,10 @@ void DungeonData::_bind_methods() {
ClassDB::bind_method(D_METHOD("setup_dungeon", "seed"), &DungeonData::setup_dungeon);
ClassDB::bind_method(D_METHOD("get_level_range"), &DungeonData::get_level_range);
ClassDB::bind_method(D_METHOD("set_level_range", "value"), &DungeonData::set_level_range);
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "level_range"), "set_level_range", "get_level_range");
//Min Size
ClassDB::bind_method(D_METHOD("get_min_sizex"), &DungeonData::get_min_sizex);
ClassDB::bind_method(D_METHOD("set_min_sizex", "value"), &DungeonData::set_min_sizex);

View File

@ -15,6 +15,9 @@ class DungeonData : public Resource {
GDCLASS(DungeonData, Resource);
public:
Vector2 get_level_range();
void set_level_range(Vector2 value);
//Min Size
int get_min_sizex();
void set_min_sizex(int value);
@ -117,6 +120,8 @@ protected:
static void _bind_methods();
private:
Vector2 _level_range;
int _min_sizex;
int _min_sizey;
int _min_sizez;

View File

@ -1,5 +1,12 @@
#include "dungeon_room_data.h"
Vector2 DungeonRoomData::get_level_range() {
return _level_range;
}
void DungeonRoomData::set_level_range(Vector2 value) {
_level_range = value;
}
//Min Size
int DungeonRoomData::get_min_sizex() {
return _min_sizex;
@ -187,6 +194,10 @@ void DungeonRoomData::_bind_methods() {
ClassDB::bind_method(D_METHOD("setup_room", "seed"), &DungeonRoomData::setup_room);
ClassDB::bind_method(D_METHOD("get_level_range"), &DungeonRoomData::get_level_range);
ClassDB::bind_method(D_METHOD("set_level_range", "value"), &DungeonRoomData::set_level_range);
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "level_range"), "set_level_range", "get_level_range");
//Min Size
ClassDB::bind_method(D_METHOD("get_min_sizex"), &DungeonRoomData::get_min_sizex);
ClassDB::bind_method(D_METHOD("set_min_sizex", "value"), &DungeonRoomData::set_min_sizex);

View File

@ -13,6 +13,9 @@ class DungeonRoomData : public Resource {
GDCLASS(DungeonRoomData, Resource);
public:
Vector2 get_level_range();
void set_level_range(Vector2 value);
//Min Size
int get_min_sizex();
void set_min_sizex(int value);
@ -75,6 +78,8 @@ protected:
static void _bind_methods();
private:
Vector2 _level_range;
int _min_sizex;
int _min_sizey;
int _min_sizez;

View File

@ -7,6 +7,13 @@ void PlanetData::set_id(const int value) {
_id = value;
}
Vector2 PlanetData::get_level_range() {
return _level_range;
}
void PlanetData::set_level_range(Vector2 value) {
_level_range = value;
}
Ref<FastnoiseNoiseParams> PlanetData::get_humidity_noise_params() {
return _humidity_noise_params;
}
@ -124,6 +131,10 @@ void PlanetData::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_id", "value"), &PlanetData::set_id);
ADD_PROPERTY(PropertyInfo(Variant::INT, "id"), "set_id", "get_id");
ClassDB::bind_method(D_METHOD("get_level_range"), &PlanetData::get_level_range);
ClassDB::bind_method(D_METHOD("set_level_range", "value"), &PlanetData::set_level_range);
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "level_range"), "set_level_range", "get_level_range");
ClassDB::bind_method(D_METHOD("get_humidity_noise_params"), &PlanetData::get_humidity_noise_params);
ClassDB::bind_method(D_METHOD("set_humidity_noise_params", "value"), &PlanetData::set_humidity_noise_params);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "humidity_noise_params", PROPERTY_HINT_RESOURCE_TYPE, "FastnoiseNoiseParams"), "set_humidity_noise_params", "get_humidity_noise_params");

View File

@ -16,6 +16,9 @@ public:
int get_id() const;
void set_id(const int value);
Vector2 get_level_range();
void set_level_range(Vector2 value);
Ref<FastnoiseNoiseParams> get_humidity_noise_params();
void set_humidity_noise_params(Ref<FastnoiseNoiseParams> value);
@ -53,8 +56,10 @@ protected:
static void _bind_methods();
private:
int _id;
Vector2 _level_range;
Ref<FastnoiseNoiseParams> _humidity_noise_params;
Ref<FastnoiseNoiseParams> _temperature_noise_params;
Vector<Ref<BiomeData> > _biome_datas;

View File

@ -1,5 +1,12 @@
#include "biome.h"
Vector2 Biome::get_level_range() {
return _level_range;
}
void Biome::set_level_range(Vector2 value) {
_level_range = value;
}
Ref<EnvironmentData> Biome::get_environment() {
return _environment;
}
@ -108,6 +115,10 @@ void Biome::_bind_methods() {
ClassDB::bind_method(D_METHOD("generate_chunk", "chunk", "spawn_mobs"), &Biome::generate_chunk);
ClassDB::bind_method(D_METHOD("generate_stack", "chunk", "x", "z", "spawn_mobs"), &Biome::generate_stack);
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);
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "level_range"), "set_level_range", "get_level_range");
ClassDB::bind_method(D_METHOD("get_environment"), &Biome::get_environment);
ClassDB::bind_method(D_METHOD("set_environment", "value"), &Biome::set_environment);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "EnvironmentData"), "set_environment", "get_environment");

View File

@ -13,6 +13,9 @@ class Biome : public Reference {
GDCLASS(Biome, Reference);
public:
Vector2 get_level_range();
void set_level_range(Vector2 value);
//Environment
Ref<EnvironmentData> get_environment();
void set_environment(Ref<EnvironmentData> value);
@ -51,6 +54,8 @@ protected:
static void _bind_methods();
private:
Vector2 _level_range;
Ref<EnvironmentData> _environment;
Vector<Ref<PropData> > _prop_datas;
Vector<Ref<EntityData> > _entity_datas;

View File

@ -7,6 +7,13 @@ void Dungeon::set_seed(int value) {
_seed = value;
}
Vector2 Dungeon::get_level_range() {
return _level_range;
}
void Dungeon::set_level_range(Vector2 value) {
_level_range = value;
}
//Position
int Dungeon::get_posx() {
return _posx;
@ -245,6 +252,10 @@ void Dungeon::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_seed", "value"), &Dungeon::set_seed);
ADD_PROPERTY(PropertyInfo(Variant::INT, "seed"), "set_seed", "get_seed");
ClassDB::bind_method(D_METHOD("get_level_range"), &Dungeon::get_level_range);
ClassDB::bind_method(D_METHOD("set_level_range", "value"), &Dungeon::set_level_range);
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "level_range"), "set_level_range", "get_level_range");
//Position
ClassDB::bind_method(D_METHOD("get_posx"), &Dungeon::get_posx);
ClassDB::bind_method(D_METHOD("set_posx", "value"), &Dungeon::set_posx);

View File

@ -19,6 +19,9 @@ public:
int get_seed();
void set_seed(int value);
Vector2 get_level_range();
void set_level_range(Vector2 value);
//Pos
int get_posx();
void set_posx(int value);
@ -102,6 +105,8 @@ protected:
private:
int _seed;
Vector2 _level_range;
int _posx;
int _posy;
int _posz;

View File

@ -7,6 +7,13 @@ void DungeonRoom::set_seed(int value) {
_seed = value;
}
Vector2 DungeonRoom::get_level_range() {
return _level_range;
}
void DungeonRoom::set_level_range(Vector2 value) {
_level_range = value;
}
//Position
int DungeonRoom::get_posx() {
return _posx;
@ -162,6 +169,10 @@ void DungeonRoom::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_seed", "value"), &DungeonRoom::set_seed);
ADD_PROPERTY(PropertyInfo(Variant::INT, "seed"), "set_seed", "get_seed");
ClassDB::bind_method(D_METHOD("get_level_range"), &DungeonRoom::get_level_range);
ClassDB::bind_method(D_METHOD("set_level_range", "value"), &DungeonRoom::set_level_range);
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "level_range"), "set_level_range", "get_level_range");
//Position
ClassDB::bind_method(D_METHOD("get_posx"), &DungeonRoom::get_posx);
ClassDB::bind_method(D_METHOD("set_posx", "value"), &DungeonRoom::set_posx);

View File

@ -17,6 +17,9 @@ public:
int get_seed();
void set_seed(int value);
Vector2 get_level_range();
void set_level_range(Vector2 value);
//Pos
int get_posx();
void set_posx(int value);
@ -74,6 +77,8 @@ protected:
private:
int _seed;
Vector2 _level_range;
int _posx;
int _posy;
int _posz;

View File

@ -7,6 +7,13 @@ void Planet::set_seed(int value) {
_seed = value;
}
Vector2 Planet::get_level_range() {
return _level_range;
}
void Planet::set_level_range(Vector2 value) {
_level_range = value;
}
Ref<EnvironmentData> Planet::get_environment() {
return _environment;
}
@ -74,6 +81,10 @@ void Planet::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_seed", "value"), &Planet::set_seed);
ADD_PROPERTY(PropertyInfo(Variant::INT, "seed"), "set_seed", "get_seed");
ClassDB::bind_method(D_METHOD("get_level_range"), &Planet::get_level_range);
ClassDB::bind_method(D_METHOD("set_level_range", "value"), &Planet::set_level_range);
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "level_range"), "set_level_range", "get_level_range");
ClassDB::bind_method(D_METHOD("get_environment"), &Planet::get_environment);
ClassDB::bind_method(D_METHOD("set_environment", "value"), &Planet::set_environment);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "EnvironmentData"), "set_environment", "get_environment");

View File

@ -15,6 +15,9 @@ public:
int get_seed();
void set_seed(int value);
Vector2 get_level_range();
void set_level_range(Vector2 value);
//Environment
Ref<EnvironmentData> get_environment();
void set_environment(Ref<EnvironmentData> value);
@ -38,6 +41,7 @@ protected:
private:
int _seed;
Vector2 _level_range;
Ref<EnvironmentData> _environment;
Vector<Ref<Biome> > _biomes;
};