mirror of
https://github.com/Relintai/entity_spell_system.git
synced 2025-02-20 17:14:44 +01:00
Added EntityResourceCostData, also more refactorings.
This commit is contained in:
parent
fe6b3224c8
commit
ea06b2346b
2
SCsub
2
SCsub
@ -80,7 +80,9 @@ module_env.add_source_files(env.modules_sources,"pipelines/spell_damage_info.cpp
|
||||
module_env.add_source_files(env.modules_sources,"pipelines/spell_heal_info.cpp")
|
||||
module_env.add_source_files(env.modules_sources,"entities/auras/aura_data.cpp")
|
||||
module_env.add_source_files(env.modules_sources,"entities/entity.cpp")
|
||||
|
||||
module_env.add_source_files(env.modules_sources,"entities/resources/entity_resource_data.cpp")
|
||||
module_env.add_source_files(env.modules_sources,"entities/resources/entity_resource_cost_data.cpp")
|
||||
module_env.add_source_files(env.modules_sources,"entities/resources/entity_resource.cpp")
|
||||
|
||||
module_env.add_source_files(env.modules_sources,"ui/unit_frame.cpp")
|
||||
|
29
entities/resources/entity_resource_cost_data.cpp
Normal file
29
entities/resources/entity_resource_cost_data.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
#include "entity_resource_cost_data.h"
|
||||
|
||||
Ref<EntityResourceData> EntityResourceCostData::get_entity_resource_data() {
|
||||
return _entity_resource_data;
|
||||
}
|
||||
void EntityResourceCostData::set_entity_resource_data(Ref<EntityResourceData> data) {
|
||||
_entity_resource_data = data;
|
||||
}
|
||||
|
||||
int EntityResourceCostData::get_cost() {
|
||||
return _cost;
|
||||
}
|
||||
void EntityResourceCostData::set_cost(int value) {
|
||||
_cost = value;
|
||||
}
|
||||
|
||||
EntityResourceCostData::EntityResourceCostData() {
|
||||
_cost = 0;
|
||||
}
|
||||
|
||||
void EntityResourceCostData::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_entity_resource_data"), &EntityResourceCostData::get_entity_resource_data);
|
||||
ClassDB::bind_method(D_METHOD("set_entity_resource_data", "value"), &EntityResourceCostData::set_entity_resource_data);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "entity_resource_data", PROPERTY_HINT_RESOURCE_TYPE, "EntityResourceData"), "set_entity_resource_data", "get_entity_resource_data");
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_cost"), &EntityResourceCostData::get_cost);
|
||||
ClassDB::bind_method(D_METHOD("set_cost", "value"), &EntityResourceCostData::set_cost);
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "cost"), "set_cost", "get_cost");
|
||||
}
|
29
entities/resources/entity_resource_cost_data.h
Normal file
29
entities/resources/entity_resource_cost_data.h
Normal file
@ -0,0 +1,29 @@
|
||||
#ifndef ENTITY_RESOURCE_COST_DATA_H
|
||||
#define ENTITY_RESOURCE_COST_DATA_H
|
||||
|
||||
#include "core/resource.h"
|
||||
|
||||
#include "entity_resource_cost_data.h"
|
||||
#include "entity_resource_data.h"
|
||||
|
||||
class EntityResourceCostData : public Resource {
|
||||
GDCLASS(EntityResourceCostData, Resource);
|
||||
|
||||
public:
|
||||
Ref<EntityResourceData> get_entity_resource_data();
|
||||
void set_entity_resource_data(Ref<EntityResourceData> data);
|
||||
|
||||
int get_cost();
|
||||
void set_cost(int value);
|
||||
|
||||
EntityResourceCostData();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
private:
|
||||
Ref<EntityResourceData> _entity_resource_data;
|
||||
int _cost;
|
||||
};
|
||||
|
||||
#endif
|
@ -14,11 +14,6 @@ const String EntityEnums::BINDING_STRING_ENTITY_GENDER = "Male,Female";
|
||||
const String EntityEnums::BINDING_STRING_ENTITY_WINDOWS = "Loot,Container,Vendor";
|
||||
|
||||
void EntityEnums::_bind_methods() {
|
||||
BIND_CONSTANT(ENTITY_RESOURCE_TYPES_MANA);
|
||||
BIND_CONSTANT(ENTITY_RESOURCE_TYPES_RAGE);
|
||||
BIND_CONSTANT(ENTITY_RESOURCE_TYPES_ENERGY);
|
||||
BIND_CONSTANT(ENTITY_RESOURCE_TYPES_TIME_ANOMALY);
|
||||
|
||||
BIND_ENUM_CONSTANT(ENITIY_TYPE_NONE);
|
||||
BIND_ENUM_CONSTANT(ENITIY_TYPE_CREATURE);
|
||||
BIND_ENUM_CONSTANT(ENITIY_TYPE_TOTEM);
|
||||
|
@ -44,13 +44,6 @@ public:
|
||||
ENITIY_CONTROLLER_AI
|
||||
};
|
||||
|
||||
enum {
|
||||
ENTITY_RESOURCE_TYPES_MANA = 0,
|
||||
ENTITY_RESOURCE_TYPES_RAGE,
|
||||
ENTITY_RESOURCE_TYPES_ENERGY,
|
||||
ENTITY_RESOURCE_TYPES_TIME_ANOMALY,
|
||||
};
|
||||
|
||||
enum EntityFlags {
|
||||
ENITIY_FLAGS_NONE = 0,
|
||||
|
||||
|
@ -61,7 +61,9 @@
|
||||
#include "pipelines/spell_heal_info.h"
|
||||
|
||||
#include "entities/resources/entity_resource_data.h"
|
||||
#include "entities/resources/entity_resource_cost_data.h"
|
||||
#include "entities/resources/entity_resource.h"
|
||||
|
||||
#include "entities/auras/aura_data.h"
|
||||
#include "entities/entity.h"
|
||||
|
||||
@ -187,6 +189,7 @@ void register_entity_spell_system_types() {
|
||||
ClassDB::register_class<AuraData>();
|
||||
|
||||
ClassDB::register_class<EntityResourceData>();
|
||||
ClassDB::register_class<EntityResourceCostData>();
|
||||
ClassDB::register_class<EntityResource>();
|
||||
|
||||
ClassDB::register_class<AuraTriggerData>();
|
||||
|
Loading…
Reference in New Issue
Block a user