51 lines
1.5 KiB
C#
51 lines
1.5 KiB
C#
using Script.Excel;
|
|
using Script.UI;
|
|
|
|
namespace Script
|
|
{
|
|
public class GlobalManager : SingleManager<GlobalManager>
|
|
{
|
|
// public SummaryInfo summaryInfo;// 不参与数据存储
|
|
|
|
private SaveData saveData;
|
|
private SaveDataInfo currentInfo;
|
|
|
|
public SaveDataInfo CurrentInfo => currentInfo;
|
|
public int Count => saveData.Count;
|
|
public SaveData SaveData => saveData;
|
|
|
|
public GlobalManager()
|
|
{
|
|
saveData = new SaveData();
|
|
}
|
|
|
|
public void AddInfo(int id, string title, string subject)
|
|
{
|
|
currentInfo = saveData.AddInfo(id, title, subject);
|
|
}
|
|
|
|
public void AddCurrentAnswer(string title, string[] options, string[] answers)
|
|
{
|
|
var id = int.Parse(currentInfo.id);
|
|
saveData.AddAnswer(id, title, options, answers);
|
|
}
|
|
|
|
public void AddCurrentResult(int index, string[] result)
|
|
{
|
|
var id = int.Parse(currentInfo.id);
|
|
saveData.AddResult(id, index, result);
|
|
}
|
|
|
|
public void SetCurrentScoreAndOther(string score, string trueCount, string falseCount, string nullCount, string accuracy)
|
|
{
|
|
var id = int.Parse(currentInfo.id);
|
|
saveData.SetScoreAndOther(id, score, trueCount, falseCount, nullCount, accuracy);
|
|
}
|
|
|
|
public void SetTime(string time)
|
|
{
|
|
var id = int.Parse(currentInfo.id);
|
|
saveData.SetTime(id, time);
|
|
}
|
|
}
|
|
} |