mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-02-22 17:18:12 +01:00
31 lines
944 B
C++
31 lines
944 B
C++
#include "entity_resource_data.h"
|
|
|
|
int EntityResourceData::get_id() {
|
|
return _id;
|
|
}
|
|
void EntityResourceData::set_id(int value) {
|
|
_id = value;
|
|
}
|
|
|
|
Ref<EntityResource> EntityResourceData::get_entity_resource_instance() {
|
|
if (has_method("_get_entity_resource_instance")) {
|
|
return call("_get_entity_resource_instance");
|
|
}
|
|
|
|
return Ref<EntityResource>();
|
|
}
|
|
|
|
EntityResourceData::EntityResourceData() {
|
|
_id = 0;
|
|
}
|
|
|
|
void EntityResourceData::_bind_methods() {
|
|
ClassDB::bind_method(D_METHOD("get_id"), &EntityResourceData::get_id);
|
|
ClassDB::bind_method(D_METHOD("set_id", "value"), &EntityResourceData::set_id);
|
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "id"), "set_id", "get_id");
|
|
|
|
BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::OBJECT, "res", PROPERTY_HINT_RESOURCE_TYPE, "EntityResource"), "_get_entity_resource_instance"));
|
|
|
|
ClassDB::bind_method(D_METHOD("get_entity_resource_instance"), &EntityResourceData::get_entity_resource_instance);
|
|
}
|