mirror of
https://github.com/Relintai/voxelman.git
synced 2024-11-14 10:17:20 +01:00
Added VoxelmanPropEntity.
This commit is contained in:
parent
440b4eadfb
commit
9bc8ccd0e7
1
SCsub
1
SCsub
@ -32,5 +32,6 @@ env.add_source_files(env.modules_sources,"props/voxelman_prop_scene.cpp")
|
|||||||
env.add_source_files(env.modules_sources,"props/voxelman_prop_mesh.cpp")
|
env.add_source_files(env.modules_sources,"props/voxelman_prop_mesh.cpp")
|
||||||
env.add_source_files(env.modules_sources,"props/voxelman_prop_light.cpp")
|
env.add_source_files(env.modules_sources,"props/voxelman_prop_light.cpp")
|
||||||
env.add_source_files(env.modules_sources,"props/voxelman_prop_prop.cpp")
|
env.add_source_files(env.modules_sources,"props/voxelman_prop_prop.cpp")
|
||||||
|
env.add_source_files(env.modules_sources,"props/voxelman_prop_entity.cpp")
|
||||||
|
|
||||||
env.add_source_files(env.modules_sources,"level_generator/voxelman_level_generator.cpp")
|
env.add_source_files(env.modules_sources,"level_generator/voxelman_level_generator.cpp")
|
||||||
|
33
props/voxelman_prop_entity.cpp
Normal file
33
props/voxelman_prop_entity.cpp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#include "voxelman_prop_entity.h"
|
||||||
|
|
||||||
|
|
||||||
|
int VoxelmanPropEntity::get_entity_data_id() const {
|
||||||
|
return _entity_data_id;
|
||||||
|
}
|
||||||
|
void VoxelmanPropEntity::set_entity_data_id(const int value) {
|
||||||
|
_entity_data_id = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
int VoxelmanPropEntity::get_level() const {
|
||||||
|
return _level;
|
||||||
|
}
|
||||||
|
void VoxelmanPropEntity::set_level(const int value) {
|
||||||
|
_level = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
VoxelmanPropEntity::VoxelmanPropEntity() {
|
||||||
|
_entity_data_id = 0;
|
||||||
|
_level = 1;
|
||||||
|
}
|
||||||
|
VoxelmanPropEntity::~VoxelmanPropEntity() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void VoxelmanPropEntity::_bind_methods() {
|
||||||
|
ClassDB::bind_method(D_METHOD("get_entity_data_id"), &VoxelmanPropEntity::get_entity_data_id);
|
||||||
|
ClassDB::bind_method(D_METHOD("set_entity_data_id", "value"), &VoxelmanPropEntity::set_entity_data_id);
|
||||||
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "entity_data_id"), "set_entity_data_id", "get_entity_data_id");
|
||||||
|
|
||||||
|
ClassDB::bind_method(D_METHOD("get_level"), &VoxelmanPropEntity::get_level);
|
||||||
|
ClassDB::bind_method(D_METHOD("set_level", "value"), &VoxelmanPropEntity::set_level);
|
||||||
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "level"), "set_level", "get_level");
|
||||||
|
}
|
27
props/voxelman_prop_entity.h
Normal file
27
props/voxelman_prop_entity.h
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#ifndef VOXELMAN_PROP_ENTITY_H
|
||||||
|
#define VOXELMAN_PROP_ENTITY_H
|
||||||
|
|
||||||
|
#include "voxelman_prop_entry.h"
|
||||||
|
|
||||||
|
class VoxelmanPropEntity : public VoxelmanPropEntry {
|
||||||
|
GDCLASS(VoxelmanPropEntity, VoxelmanPropEntry);
|
||||||
|
|
||||||
|
public:
|
||||||
|
int get_entity_data_id() const;
|
||||||
|
void set_entity_data_id(const int value);
|
||||||
|
|
||||||
|
int get_level() const;
|
||||||
|
void set_level(const int value);
|
||||||
|
|
||||||
|
VoxelmanPropEntity();
|
||||||
|
~VoxelmanPropEntity();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
static void _bind_methods();
|
||||||
|
|
||||||
|
private:
|
||||||
|
int _level;
|
||||||
|
int _entity_data_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -25,6 +25,7 @@
|
|||||||
#include "props/voxelman_prop_mesh.h"
|
#include "props/voxelman_prop_mesh.h"
|
||||||
#include "props/voxelman_prop_light.h"
|
#include "props/voxelman_prop_light.h"
|
||||||
#include "props/voxelman_prop_prop.h"
|
#include "props/voxelman_prop_prop.h"
|
||||||
|
#include "props/voxelman_prop_entity.h"
|
||||||
|
|
||||||
#include "level_generator/voxelman_level_generator.h"
|
#include "level_generator/voxelman_level_generator.h"
|
||||||
|
|
||||||
@ -55,6 +56,7 @@ void register_voxelman_types() {
|
|||||||
ClassDB::register_class<VoxelmanPropMesh>();
|
ClassDB::register_class<VoxelmanPropMesh>();
|
||||||
ClassDB::register_class<VoxelmanPropLight>();
|
ClassDB::register_class<VoxelmanPropLight>();
|
||||||
ClassDB::register_class<VoxelmanPropProp>();
|
ClassDB::register_class<VoxelmanPropProp>();
|
||||||
|
ClassDB::register_class<VoxelmanPropEntity>();
|
||||||
|
|
||||||
ClassDB::register_class<VoxelmanLevelGenerator>();
|
ClassDB::register_class<VoxelmanLevelGenerator>();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user