Removed get_entity_type from EntityData, Entity now uses the one from EntitySpeciesData.

This commit is contained in:
Relintai 2020-10-19 11:48:00 +02:00
parent ee099a0f0e
commit 83a688f9dc
3 changed files with 8 additions and 18 deletions

View File

@ -46,13 +46,6 @@ void EntityData::set_text_description(String value) {
_text_description = value;
}
int EntityData::get_entity_type() const {
return _entity_type;
}
void EntityData::set_entity_type(const int value) {
_entity_type = value;
}
EntityEnums::EntityInteractionType EntityData::get_entity_interaction_type() const {
return _interaction_type;
}
@ -247,7 +240,6 @@ EntityData::EntityData() {
_bag_size = 0;
_is_playable = false;
_entity_type = 0;
_interaction_type = EntityEnums::ENITIY_INTERACTION_TYPE_NORMAL;
_immunity_flags = 0;
_entity_flags = 0;
@ -281,10 +273,6 @@ void EntityData::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_id", "value"), &EntityData::set_id);
ADD_PROPERTY(PropertyInfo(Variant::INT, "id"), "set_id", "get_id");
ClassDB::bind_method(D_METHOD("get_entity_type"), &EntityData::get_entity_type);
ClassDB::bind_method(D_METHOD("set_entity_type", "value"), &EntityData::set_entity_type);
ADD_PROPERTY(PropertyInfo(Variant::INT, "entity_type", PROPERTY_HINT_ENUM, ""), "set_entity_type", "get_entity_type");
ClassDB::bind_method(D_METHOD("get_entity_interaction_type"), &EntityData::get_entity_interaction_type);
ClassDB::bind_method(D_METHOD("set_entity_interaction_type", "value"), &EntityData::set_entity_interaction_type);
ADD_PROPERTY(PropertyInfo(Variant::INT, "entity_interaction_type", PROPERTY_HINT_ENUM, EntityEnums::BINDING_STRING_ENTITY_INTERACTION_TYPE), "set_entity_interaction_type", "get_entity_interaction_type");

View File

@ -63,9 +63,6 @@ public:
String get_text_description() const;
void set_text_description(const String value);
int get_entity_type() const;
void set_entity_type(const int value);
EntityEnums::EntityInteractionType get_entity_interaction_type() const;
void set_entity_interaction_type(const EntityEnums::EntityInteractionType value);
@ -126,8 +123,6 @@ protected:
private:
int _id;
int _entity_type;
EntityEnums::EntityInteractionType _interaction_type;
bool _is_playable;

View File

@ -718,7 +718,14 @@ void Entity::_setup() {
sets_entity_data_id(_s_entity_data->get_id());
sets_entity_type(_s_entity_data->get_entity_type());
Ref<EntitySpeciesData> spd = _s_entity_data->get_entity_species_data();
if (spd.is_valid()) {
sets_entity_type(spd->get_type());
} else {
sets_entity_type(0);
}
sets_entity_interaction_type(_s_entity_data->get_entity_interaction_type());
sets_immunity_flags(_s_entity_data->get_immunity_flags());
sets_entity_flags(_s_entity_data->get_entity_flags());