diff --git a/Assets/PerfectWorld/Scripts/Common/DataProcess/elementdataman.cs b/Assets/PerfectWorld/Scripts/Common/DataProcess/elementdataman.cs index a229caaf54..6939e25d96 100644 --- a/Assets/PerfectWorld/Scripts/Common/DataProcess/elementdataman.cs +++ b/Assets/PerfectWorld/Scripts/Common/DataProcess/elementdataman.cs @@ -1,7 +1,9 @@ -using System.Collections.Generic; +using BrewMonster; +using System.Collections.Generic; using System.IO; +using System.Linq; using System.Text; -using BrewMonster; +using Unity.VisualScripting; namespace ModelRenderer.Scripts.GameData { @@ -41,6 +43,10 @@ namespace ModelRenderer.Scripts.GameData public Dictionary recipe_index_id_map = new Dictionary(); public Dictionary recipe_id_data_map = new Dictionary(); + public Dictionary addon_id_data_type_map = new Dictionary(); + public Dictionary addon_index_id_map = new Dictionary(); + public Dictionary addon_id_data_map = new Dictionary(); + public EQUIPMENT_ADDON[] equipment_addon_array = new EQUIPMENT_ADDON[0]; public WEAPON_MAJOR_TYPE[] weapon_major_type_array = new WEAPON_MAJOR_TYPE[0]; public WEAPON_SUB_TYPE[] weapon_sub_type_array = new WEAPON_SUB_TYPE[0]; @@ -1406,7 +1412,17 @@ namespace ModelRenderer.Scripts.GameData case ID_SPACE.ID_SPACE_ESSENCE: essence_id_data_type_map[id] = type; break; - + case ID_SPACE.ID_SPACE_ADDON: + addon_id_data_type_map[id] = type; + break; + //case ID_SPACE.ID_SPACE_TALK: + // add_id_index_talk(id, type, pos, start); + // break; + //case ID_SPACE.ID_SPACE_FACE: + // add_id_index_face(id, type, pos, start); + // break; + //case ID_SPACE.ID_SPACE_RECIPE: + // add_id_index_recipe(id, type, pos, start); case ID_SPACE.ID_SPACE_CONFIG: config_id_data_type_map[id] = type; break; @@ -1453,6 +1469,10 @@ namespace ModelRenderer.Scripts.GameData id = recipe_index_id_map[index]; dataType = recipe_id_data_type_map[id]; break; + case ID_SPACE.ID_SPACE_ADDON: + id = addon_index_id_map[index]; + dataType = addon_id_data_type_map[id]; + break; default: break; @@ -1501,6 +1521,17 @@ namespace ModelRenderer.Scripts.GameData { case ID_SPACE.ID_SPACE_ESSENCE: return essence_id_data_type_map.Count; + case ID_SPACE.ID_SPACE_ADDON: + return addon_id_data_type_map.Count; + + // case ID_SPACE.ID_SPACE_TALK: + // return talk_id_index_map.Count; + + // case ID_SPACE.ID_SPACE_FACE: + // return face_id_index_map.Count; + + // case ID_SPACE.ID_SPACE_RECIPE: + // return recipe_id_index_map.Count; case ID_SPACE.ID_SPACE_CONFIG: return config_id_data_type_map.Count; @@ -1536,6 +1567,12 @@ namespace ModelRenderer.Scripts.GameData return configType; } break; + case ID_SPACE.ID_SPACE_ADDON: + if (addon_id_data_type_map.TryGetValue(id, out DATA_TYPE addonType)) + { + return addonType; + } + break; case ID_SPACE.ID_SPACE_TALK: if (talk_id_data_type_map.TryGetValue(id, out DATA_TYPE talkType)) @@ -1606,11 +1643,116 @@ namespace ModelRenderer.Scripts.GameData } break; + case ID_SPACE.ID_SPACE_ADDON: + if (addon_id_data_map.TryGetValue(id, out data)) + { + dataType = addon_id_data_type_map[id]; + return data; + } + break; + default: return null; } return null; } + + //public uint get_first_data_id(ID_SPACE idspace,ref DATA_TYPE datatype) + //{ + // uint id = 0; + // switch (idspace) + // { + // case ID_SPACE.ID_SPACE_ESSENCE: + // if (essence_id_data_type_map.Count==0) + // { + // id = 0; + // datatype = DATA_TYPE.DT_INVALID; + // } + // else + // { + // var firstElement = essence_id_data_type_map.FirstOrDefault(); + // id = firstElement.Key; + // datatype = firstElement.Value; + // } + // break; + + // case ID_SPACE.ID_SPACE_ADDON: + // addon_id_index_itr = addon_id_index_map.begin(); + // if (addon_id_index_itr == addon_id_index_map.end()) + // { + // id = 0; + // datatype = DT_INVALID; + // } + // else + // { + // id = addon_id_index_itr->first; + // datatype = (addon_id_index_itr->second).type; + // } + // break; + + // case ID_SPACE.ID_SPACE_TALK: + // talk_id_index_itr = talk_id_index_map.begin(); + // if (talk_id_index_itr == talk_id_index_map.end()) + // { + // id = 0; + // datatype = DT_INVALID; + // } + // else + // { + // id = talk_id_index_itr->first; + // datatype = (talk_id_index_itr->second).type; + // } + // break; + + // case ID_SPACE.ID_SPACE_FACE: + // face_id_index_itr = face_id_index_map.begin(); + // if (face_id_index_itr == face_id_index_map.end()) + // { + // id = 0; + // datatype = DT_INVALID; + // } + // else + // { + // id = face_id_index_itr->first; + // datatype = (face_id_index_itr->second).type; + // } + // break; + + // case ID_SPACE.ID_SPACE_RECIPE: + // recipe_id_index_itr = recipe_id_index_map.begin(); + // if (recipe_id_index_itr == recipe_id_index_map.end()) + // { + // id = 0; + // datatype = DT_INVALID; + // } + // else + // { + // id = recipe_id_index_itr->first; + // datatype = (recipe_id_index_itr->second).type; + // } + // break; + + // case ID_SPACE.ID_SPACE_CONFIG: + // config_id_index_itr = config_id_index_map.begin(); + // if (config_id_index_itr == config_id_index_map.end()) + // { + // id = 0; + // datatype = DT_INVALID; + // } + // else + // { + // id = config_id_index_itr->first; + // datatype = (config_id_index_itr->second).type; + // } + // break; + + // default: + // id = 0; + // datatype = DATA_TYPE.DT_INVALID; + // break; + // } + // return id; + //} } } \ No newline at end of file