using System.Collections; using System.Collections.Generic; namespace DongWuYiXue.Main { public class ExcelData { public List allLanguageData = null; public List allMainData = null; public IEnumerator Init(string path) { yield return ExcelDataTools.GetDataList(path,value=>allLanguageData = value); yield return ExcelDataTools.GetDataList(path,value=>allMainData = value); } public LanguageData GetLanguageData(int id) { for (int i = 0; i < allLanguageData.Count; i++) { if (allLanguageData[i].id == id) { return allLanguageData[i]; } } return null; } public MainData GetMainData(int id) { for (int i = 0; i < allMainData.Count; i++) { if (allMainData[i].id == id) { return allMainData[i]; } } return null; } public LanguageData GetLanguageDataid(int id) { for (int i = 0; i < allLanguageData.Count; i++) { if (allLanguageData[i].id == id) { return allLanguageData[i]; } } return null; } public List GetListLanguageDataid() { List res = new List(); for (int i = 0; i < allLanguageData.Count; i++) { if (!res.Contains(allLanguageData[i].id)) { res.Add(allLanguageData[i].id); } } return res; } public LanguageData GetLanguageDataChinese(string Chinese) { for (int i = 0; i < allLanguageData.Count; i++) { if (allLanguageData[i].Chinese == Chinese) { return allLanguageData[i]; } } return null; } public List GetListLanguageDataChinese() { List res = new List(); for (int i = 0; i < allLanguageData.Count; i++) { if (!res.Contains(allLanguageData[i].Chinese)) { res.Add(allLanguageData[i].Chinese); } } return res; } public LanguageData GetLanguageDataEnglish(string English) { for (int i = 0; i < allLanguageData.Count; i++) { if (allLanguageData[i].English == English) { return allLanguageData[i]; } } return null; } public List GetListLanguageDataEnglish() { List res = new List(); for (int i = 0; i < allLanguageData.Count; i++) { if (!res.Contains(allLanguageData[i].English)) { res.Add(allLanguageData[i].English); } } return res; } public LanguageData GetLanguageDataJapanese(string Japanese) { for (int i = 0; i < allLanguageData.Count; i++) { if (allLanguageData[i].Japanese == Japanese) { return allLanguageData[i]; } } return null; } public List GetListLanguageDataJapanese() { List res = new List(); for (int i = 0; i < allLanguageData.Count; i++) { if (!res.Contains(allLanguageData[i].Japanese)) { res.Add(allLanguageData[i].Japanese); } } return res; } public LanguageData GetLanguageDataFrench(string French) { for (int i = 0; i < allLanguageData.Count; i++) { if (allLanguageData[i].French == French) { return allLanguageData[i]; } } return null; } public List GetListLanguageDataFrench() { List res = new List(); for (int i = 0; i < allLanguageData.Count; i++) { if (!res.Contains(allLanguageData[i].French)) { res.Add(allLanguageData[i].French); } } return res; } public MainData GetMainDataid(int id) { for (int i = 0; i < allMainData.Count; i++) { if (allMainData[i].id == id) { return allMainData[i]; } } return null; } public List GetListMainDataid() { List res = new List(); for (int i = 0; i < allMainData.Count; i++) { if (!res.Contains(allMainData[i].id)) { res.Add(allMainData[i].id); } } return res; } public MainData GetMainDataname(string name) { for (int i = 0; i < allMainData.Count; i++) { if (allMainData[i].name == name) { return allMainData[i]; } } return null; } public List GetListMainDataname() { List res = new List(); for (int i = 0; i < allMainData.Count; i++) { if (!res.Contains(allMainData[i].name)) { res.Add(allMainData[i].name); } } return res; } public MainData GetMainDatatexture(string texture) { for (int i = 0; i < allMainData.Count; i++) { if (allMainData[i].texture == texture) { return allMainData[i]; } } return null; } public List GetListMainDatatexture() { List res = new List(); for (int i = 0; i < allMainData.Count; i++) { if (!res.Contains(allMainData[i].texture)) { res.Add(allMainData[i].texture); } } return res; } public MainData GetMainDatascene(string scene) { for (int i = 0; i < allMainData.Count; i++) { if (allMainData[i].scene == scene) { return allMainData[i]; } } return null; } public List GetListMainDatascene() { List res = new List(); for (int i = 0; i < allMainData.Count; i++) { if (!res.Contains(allMainData[i].scene)) { res.Add(allMainData[i].scene); } } return res; } public MainData GetMainDatanameSpace(string nameSpace) { for (int i = 0; i < allMainData.Count; i++) { if (allMainData[i].nameSpace == nameSpace) { return allMainData[i]; } } return null; } public List GetListMainDatanameSpace() { List res = new List(); for (int i = 0; i < allMainData.Count; i++) { if (!res.Contains(allMainData[i].nameSpace)) { res.Add(allMainData[i].nameSpace); } } return res; } public MainData GetMainDatafsmManager(string fsmManager) { for (int i = 0; i < allMainData.Count; i++) { if (allMainData[i].fsmManager == fsmManager) { return allMainData[i]; } } return null; } public List GetListMainDatafsmManager() { List res = new List(); for (int i = 0; i < allMainData.Count; i++) { if (!res.Contains(allMainData[i].fsmManager)) { res.Add(allMainData[i].fsmManager); } } return res; } public MainData GetMainDatafsmClassPath(string fsmClassPath) { for (int i = 0; i < allMainData.Count; i++) { if (allMainData[i].fsmClassPath == fsmClassPath) { return allMainData[i]; } } return null; } public List GetListMainDatafsmClassPath() { List res = new List(); for (int i = 0; i < allMainData.Count; i++) { if (!res.Contains(allMainData[i].fsmClassPath)) { res.Add(allMainData[i].fsmClassPath); } } return res; } public MainData GetMainDatafolder(string folder) { for (int i = 0; i < allMainData.Count; i++) { if (allMainData[i].folder == folder) { return allMainData[i]; } } return null; } public List GetListMainDatafolder() { List res = new List(); for (int i = 0; i < allMainData.Count; i++) { if (!res.Contains(allMainData[i].folder)) { res.Add(allMainData[i].folder); } } return res; } } }