396 lines
7.7 KiB
C#
Raw Normal View History

2025-09-08 14:51:28 +08:00

using System.Collections;
using System.Collections.Generic;
2025-09-08 17:37:12 +08:00
namespace DongWuYiXue.Main
2025-09-08 14:51:28 +08:00
{
public class ExcelData
{
public List<LanguageData> allLanguageData = null;
public List<MainData> allMainData = null;
public IEnumerator Init(string path)
{
yield return ExcelDataTools.GetDataList<LanguageData>(path,value=>allLanguageData = value);
yield return ExcelDataTools.GetDataList<MainData>(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<int> GetListLanguageDataid()
{
List<int> res = new List<int>();
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<string> GetListLanguageDataChinese()
{
List<string> res = new List<string>();
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<string> GetListLanguageDataEnglish()
{
List<string> res = new List<string>();
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<string> GetListLanguageDataJapanese()
{
List<string> res = new List<string>();
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<string> GetListLanguageDataFrench()
{
List<string> res = new List<string>();
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<int> GetListMainDataid()
{
List<int> res = new List<int>();
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<string> GetListMainDataname()
{
List<string> res = new List<string>();
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<string> GetListMainDatatexture()
{
List<string> res = new List<string>();
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<string> GetListMainDatascene()
{
List<string> res = new List<string>();
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<string> GetListMainDatanameSpace()
{
List<string> res = new List<string>();
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<string> GetListMainDatafsmManager()
{
List<string> res = new List<string>();
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<string> GetListMainDatafsmClassPath()
{
List<string> res = new List<string>();
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<string> GetListMainDatafolder()
{
List<string> res = new List<string>();
for (int i = 0; i < allMainData.Count; i++)
{
if (!res.Contains(allMainData[i].folder))
{
res.Add(allMainData[i].folder);
}
}
return res;
}
}
}