#ifndef ESS_RESOURCE_DB_H #define ESS_RESOURCE_DB_H #include "core/bind/core_bind.h" #include "core/containers/hash_map.h" #include "core/object/resource.h" #include "core/string/ustring.h" #include "core/variant/variant.h" #include "core/containers/vector.h" #include "../item_enums.h" class Spell; class EntityData; class CraftRecipe; class ItemTemplate; class EntityResource; class EntitySkillData; class EntityCreateInfo; class SpellCastInfo; class EntitySpeciesData; class ESSResourceDB : public Resource { GDCLASS(ESSResourceDB, Resource); public: Ref get_skill_for_armor_type(const int index); void set_skill_for_armor_type(const int index, const Ref &aura); virtual Ref get_entity_resource(int class_id) = 0; virtual Ref get_entity_resource_index(int index) = 0; virtual int get_entity_resource_count() = 0; virtual void add_entity_resource(Ref cls); virtual Vector get_entity_resources() const = 0; virtual void set_entity_resources(const Vector &data) = 0; Ref get_entity_resource_path(const StringName &path); StringName entity_resource_id_to_path(const int id) const; int entity_resource_path_to_id(const StringName &path) const; virtual Ref get_entity_skill(int class_id) = 0; virtual Ref get_entity_skill_index(int index) = 0; virtual int get_entity_skill_count() = 0; virtual void add_entity_skill(Ref cls); virtual Vector get_entity_skills() const = 0; virtual void set_entity_skills(const Vector &data) = 0; Ref get_entity_skill_path(const StringName &path); StringName entity_skill_id_to_path(const int id) const; int entity_skill_path_to_id(const StringName &path) const; virtual Ref get_entity_data(int class_id) = 0; virtual Ref get_entity_data_index(int index) = 0; virtual int get_entity_data_count() = 0; virtual void add_entity_data(Ref cls); virtual Vector get_entity_datas() const = 0; virtual void set_entity_datas(const Vector &data) = 0; Ref get_entity_data_path(const StringName &path); StringName entity_data_id_to_path(const int id) const; int entity_data_path_to_id(const StringName &path) const; virtual Ref get_spell(int spell_id) = 0; virtual Ref get_spell_index(int index) = 0; virtual int get_spell_count() = 0; virtual void add_spell(Ref spell); virtual Vector get_spells() const = 0; virtual void set_spells(const Vector &data) = 0; Ref get_spell_path(const StringName &path); StringName spell_id_to_path(const int id) const; int spell_path_to_id(const StringName &path) const; virtual Ref get_craft_recipe(int craft_id) = 0; virtual Ref get_craft_recipe_index(int index) = 0; virtual int get_craft_recipe_count() = 0; virtual void add_craft_recipe(Ref aura); virtual Vector get_craft_recipes() const = 0; virtual void set_craft_recipes(const Vector &data) = 0; Ref get_craft_recipe_path(const StringName &path); StringName craft_recipe_id_to_path(const int id) const; int craft_recipe_path_to_id(const StringName &path) const; virtual void add_item_template(Ref aura); virtual Ref get_item_template(int item_id) = 0; virtual Ref get_item_template_index(int index) = 0; virtual int get_item_template_count() = 0; virtual Vector get_item_templates() const = 0; virtual void set_item_templates(const Vector &data) = 0; Ref get_item_template_path(const StringName &path); StringName item_template_id_to_path(const int id) const; int item_template_path_to_id(const StringName &path) const; virtual void add_entity_species_data(Ref aura); virtual Ref get_entity_species_data(int item_id) = 0; virtual Ref get_entity_species_data_index(int index) = 0; virtual int get_entity_species_data_count() = 0; virtual Vector get_entity_species_datas() const = 0; virtual void set_entity_species_datas(const Vector &data) = 0; Ref get_entity_species_data_path(const StringName &path); StringName entity_species_id_to_path(const int id) const; int entity_species_path_to_id(const StringName &path) const; virtual void clear(); void add_entity_resource_db(Ref other); void initialize(); ESSResourceDB(); ~ESSResourceDB(); protected: static void _bind_methods(); Ref _armor_type_skills[ItemEnums::ARMOR_TYPE_MAX]; HashMap _entity_resources_id_to_path; HashMap _entity_resources_path_to_id; HashMap _entity_skill_id_to_path; HashMap _entity_skill_path_to_id; HashMap _entity_data_id_to_path; HashMap _entity_data_path_to_id; HashMap _spell_id_to_path; HashMap _spell_path_to_id; HashMap _craft_recipe_id_to_path; HashMap _craft_recipe_path_to_id; HashMap _item_template_id_to_path; HashMap _item_template_path_to_id; HashMap _entity_species_id_to_path; HashMap _entity_species_path_to_id; }; #endif