using System.Collections; using System.Collections.Generic; namespace YiLiao.JingMaiLiuZhiZhen { public class ExcelData { public List allBaseData = null; public List allBookPanelData = null; public List allStateData = null; public List allTreeViewData = null; public IEnumerator Init(string path) { yield return ExcelDataTools.GetDataList(path,value=>allBaseData = value); yield return ExcelDataTools.GetDataList(path,value=>allBookPanelData = value); yield return ExcelDataTools.GetDataList(path,value=>allStateData = value); yield return ExcelDataTools.GetDataList(path,value=>allTreeViewData = value); } public BaseData GetBaseData(int id) { for (int i = 0; i < allBaseData.Count; i++) { if (allBaseData[i].id == id) { return allBaseData[i]; } } return null; } public BookPanelData GetBookPanelData(int id) { for (int i = 0; i < allBookPanelData.Count; i++) { if (allBookPanelData[i].id == id) { return allBookPanelData[i]; } } return null; } public StateData GetStateData(int id) { for (int i = 0; i < allStateData.Count; i++) { if (allStateData[i].id == id) { return allStateData[i]; } } return null; } public TreeViewData GetTreeViewData(int id) { for (int i = 0; i < allTreeViewData.Count; i++) { if (allTreeViewData[i].id == id) { return allTreeViewData[i]; } } return null; } public BaseData GetBaseDataid(int id) { for (int i = 0; i < allBaseData.Count; i++) { if (allBaseData[i].id == id) { return allBaseData[i]; } } return null; } public List GetListBaseDataid() { List res = new List(); for (int i = 0; i < allBaseData.Count; i++) { if (!res.Contains(allBaseData[i].id)) { res.Add(allBaseData[i].id); } } return res; } public BaseData GetBaseDataparentName(string parentName) { for (int i = 0; i < allBaseData.Count; i++) { if (allBaseData[i].parentName == parentName) { return allBaseData[i]; } } return null; } public List GetListBaseDataparentName() { List res = new List(); for (int i = 0; i < allBaseData.Count; i++) { if (!res.Contains(allBaseData[i].parentName)) { res.Add(allBaseData[i].parentName); } } return res; } public BaseData GetBaseDataname(string name) { for (int i = 0; i < allBaseData.Count; i++) { if (allBaseData[i].name == name) { return allBaseData[i]; } } return null; } public List GetListBaseDataname() { List res = new List(); for (int i = 0; i < allBaseData.Count; i++) { if (!res.Contains(allBaseData[i].name)) { res.Add(allBaseData[i].name); } } return res; } public BaseData GetBaseDataowner(string owner) { for (int i = 0; i < allBaseData.Count; i++) { if (allBaseData[i].owner == owner) { return allBaseData[i]; } } return null; } public List GetListBaseDataowner() { List res = new List(); for (int i = 0; i < allBaseData.Count; i++) { if (!res.Contains(allBaseData[i].owner)) { res.Add(allBaseData[i].owner); } } return res; } public BaseData GetBaseDatatxt(string txt) { for (int i = 0; i < allBaseData.Count; i++) { if (allBaseData[i].txt == txt) { return allBaseData[i]; } } return null; } public List GetListBaseDatatxt() { List res = new List(); for (int i = 0; i < allBaseData.Count; i++) { if (!res.Contains(allBaseData[i].txt)) { res.Add(allBaseData[i].txt); } } return res; } public BaseData GetBaseDatasound(string sound) { for (int i = 0; i < allBaseData.Count; i++) { if (allBaseData[i].sound == sound) { return allBaseData[i]; } } return null; } public List GetListBaseDatasound() { List res = new List(); for (int i = 0; i < allBaseData.Count; i++) { if (!res.Contains(allBaseData[i].sound)) { res.Add(allBaseData[i].sound); } } return res; } public BaseData GetBaseDataobj(string obj) { for (int i = 0; i < allBaseData.Count; i++) { if (allBaseData[i].obj == obj) { return allBaseData[i]; } } return null; } public List GetListBaseDataobj() { List res = new List(); for (int i = 0; i < allBaseData.Count; i++) { if (!res.Contains(allBaseData[i].obj)) { res.Add(allBaseData[i].obj); } } return res; } public BaseData GetBaseDatastate(string state) { for (int i = 0; i < allBaseData.Count; i++) { if (allBaseData[i].state == state) { return allBaseData[i]; } } return null; } public List GetListBaseDatastate() { List res = new List(); for (int i = 0; i < allBaseData.Count; i++) { if (!res.Contains(allBaseData[i].state)) { res.Add(allBaseData[i].state); } } return res; } public BaseData GetBaseDatascore_kh(string score_kh) { for (int i = 0; i < allBaseData.Count; i++) { if (allBaseData[i].score_kh == score_kh) { return allBaseData[i]; } } return null; } public List GetListBaseDatascore_kh() { List res = new List(); for (int i = 0; i < allBaseData.Count; i++) { if (!res.Contains(allBaseData[i].score_kh)) { res.Add(allBaseData[i].score_kh); } } return res; } public BaseData GetBaseDatascore(string score) { for (int i = 0; i < allBaseData.Count; i++) { if (allBaseData[i].score == score) { return allBaseData[i]; } } return null; } public List GetListBaseDatascore() { List res = new List(); for (int i = 0; i < allBaseData.Count; i++) { if (!res.Contains(allBaseData[i].score)) { res.Add(allBaseData[i].score); } } return res; } public BaseData GetBaseDatascore_sx(string score_sx) { for (int i = 0; i < allBaseData.Count; i++) { if (allBaseData[i].score_sx == score_sx) { return allBaseData[i]; } } return null; } public List GetListBaseDatascore_sx() { List res = new List(); for (int i = 0; i < allBaseData.Count; i++) { if (!res.Contains(allBaseData[i].score_sx)) { res.Add(allBaseData[i].score_sx); } } return res; } public BaseData GetBaseDatatype(string type) { for (int i = 0; i < allBaseData.Count; i++) { if (allBaseData[i].type == type) { return allBaseData[i]; } } return null; } public List GetListBaseDatatype() { List res = new List(); for (int i = 0; i < allBaseData.Count; i++) { if (!res.Contains(allBaseData[i].type)) { res.Add(allBaseData[i].type); } } return res; } public BookPanelData GetBookPanelDataid(int id) { for (int i = 0; i < allBookPanelData.Count; i++) { if (allBookPanelData[i].id == id) { return allBookPanelData[i]; } } return null; } public List GetListBookPanelDataid() { List res = new List(); for (int i = 0; i < allBookPanelData.Count; i++) { if (!res.Contains(allBookPanelData[i].id)) { res.Add(allBookPanelData[i].id); } } return res; } public BookPanelData GetBookPanelDatagroup(string group) { for (int i = 0; i < allBookPanelData.Count; i++) { if (allBookPanelData[i].group == group) { return allBookPanelData[i]; } } return null; } public List GetListBookPanelDatagroup() { List res = new List(); for (int i = 0; i < allBookPanelData.Count; i++) { if (!res.Contains(allBookPanelData[i].group)) { res.Add(allBookPanelData[i].group); } } return res; } public BookPanelData GetBookPanelDatatxt(string txt) { for (int i = 0; i < allBookPanelData.Count; i++) { if (allBookPanelData[i].txt == txt) { return allBookPanelData[i]; } } return null; } public List GetListBookPanelDatatxt() { List res = new List(); for (int i = 0; i < allBookPanelData.Count; i++) { if (!res.Contains(allBookPanelData[i].txt)) { res.Add(allBookPanelData[i].txt); } } return res; } public StateData GetStateDataid(int id) { for (int i = 0; i < allStateData.Count; i++) { if (allStateData[i].id == id) { return allStateData[i]; } } return null; } public List GetListStateDataid() { List res = new List(); for (int i = 0; i < allStateData.Count; i++) { if (!res.Contains(allStateData[i].id)) { res.Add(allStateData[i].id); } } return res; } public StateData GetStateDatastate(string state) { for (int i = 0; i < allStateData.Count; i++) { if (allStateData[i].state == state) { return allStateData[i]; } } return null; } public List GetListStateDatastate() { List res = new List(); for (int i = 0; i < allStateData.Count; i++) { if (!res.Contains(allStateData[i].state)) { res.Add(allStateData[i].state); } } return res; } public StateData GetStateDatatrigger(string trigger) { for (int i = 0; i < allStateData.Count; i++) { if (allStateData[i].trigger == trigger) { return allStateData[i]; } } return null; } public List GetListStateDatatrigger() { List res = new List(); for (int i = 0; i < allStateData.Count; i++) { if (!res.Contains(allStateData[i].trigger)) { res.Add(allStateData[i].trigger); } } return res; } public StateData GetStateDataremark(string remark) { for (int i = 0; i < allStateData.Count; i++) { if (allStateData[i].remark == remark) { return allStateData[i]; } } return null; } public List GetListStateDataremark() { List res = new List(); for (int i = 0; i < allStateData.Count; i++) { if (!res.Contains(allStateData[i].remark)) { res.Add(allStateData[i].remark); } } return res; } public TreeViewData GetTreeViewDataid(int id) { for (int i = 0; i < allTreeViewData.Count; i++) { if (allTreeViewData[i].id == id) { return allTreeViewData[i]; } } return null; } public List GetListTreeViewDataid() { List res = new List(); for (int i = 0; i < allTreeViewData.Count; i++) { if (!res.Contains(allTreeViewData[i].id)) { res.Add(allTreeViewData[i].id); } } return res; } public TreeViewData GetTreeViewDatadata1(string data1) { for (int i = 0; i < allTreeViewData.Count; i++) { if (allTreeViewData[i].data1 == data1) { return allTreeViewData[i]; } } return null; } public List GetListTreeViewDatadata1() { List res = new List(); for (int i = 0; i < allTreeViewData.Count; i++) { if (!res.Contains(allTreeViewData[i].data1)) { res.Add(allTreeViewData[i].data1); } } return res; } public TreeViewData GetTreeViewDatadata2(string data2) { for (int i = 0; i < allTreeViewData.Count; i++) { if (allTreeViewData[i].data2 == data2) { return allTreeViewData[i]; } } return null; } public List GetListTreeViewDatadata2() { List res = new List(); for (int i = 0; i < allTreeViewData.Count; i++) { if (!res.Contains(allTreeViewData[i].data2)) { res.Add(allTreeViewData[i].data2); } } return res; } public TreeViewData GetTreeViewDatastate(string state) { for (int i = 0; i < allTreeViewData.Count; i++) { if (allTreeViewData[i].state == state) { return allTreeViewData[i]; } } return null; } public List GetListTreeViewDatastate() { List res = new List(); for (int i = 0; i < allTreeViewData.Count; i++) { if (!res.Contains(allTreeViewData[i].state)) { res.Add(allTreeViewData[i].state); } } return res; } } }