2019-11-30 19:26:12 +01:00
|
|
|
#include "entity_resource_data.h"
|
|
|
|
|
2019-12-01 18:00:09 +01:00
|
|
|
#include "entity_resource.h"
|
|
|
|
|
2019-11-30 21:46:11 +01:00
|
|
|
int EntityResourceData::get_id() {
|
|
|
|
return _id;
|
|
|
|
}
|
|
|
|
void EntityResourceData::set_id(int value) {
|
|
|
|
_id = value;
|
|
|
|
}
|
|
|
|
|
2019-12-02 00:42:21 +01:00
|
|
|
String EntityResourceData::get_text_description() {
|
|
|
|
return _text_description;
|
|
|
|
}
|
|
|
|
void EntityResourceData::set_text_description(String value) {
|
|
|
|
_text_description = value;
|
|
|
|
}
|
|
|
|
|
2019-11-30 19:26:12 +01:00
|
|
|
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() {
|
2019-11-30 21:46:11 +01:00
|
|
|
_id = 0;
|
2019-11-30 19:26:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void EntityResourceData::_bind_methods() {
|
2019-11-30 21:46:11 +01:00
|
|
|
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");
|
|
|
|
|
2019-11-30 19:26:12 +01:00
|
|
|
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);
|
2019-12-02 00:42:21 +01:00
|
|
|
|
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::STRING, "text_name"), "set_name", "get_name");
|
|
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("get_text_description"), &EntityResourceData::get_text_description);
|
|
|
|
ClassDB::bind_method(D_METHOD("set_text_description", "value"), &EntityResourceData::set_text_description);
|
|
|
|
ADD_PROPERTY(PropertyInfo(Variant::STRING, "text_description", PROPERTY_HINT_MULTILINE_TEXT), "set_text_description", "get_text_description");
|
|
|
|
|
2019-11-30 19:26:12 +01:00
|
|
|
}
|