Move some classes to Cryville.Common.

This commit is contained in:
2023-05-03 22:51:30 +08:00
parent 8f211568be
commit b143fb49ce
90 changed files with 788 additions and 2457 deletions

View File

@@ -19,7 +19,7 @@ namespace Cryville.Crtr {
= new Dictionary<Identifier, List<JudgeEvent>>();
readonly Dictionary<Identifier, List<JudgeEvent>> activeEvs
= new Dictionary<Identifier, List<JudgeEvent>>();
static readonly int _var_pause = IdentifierManager.SharedInstance.Request("pause");
static readonly int _var_pause = IdentifierManager.Shared.Request("pause");
readonly JudgeDefinition _judgePause;
public struct JudgeEvent {
public double StartTime { get; set; }
@@ -91,15 +91,15 @@ namespace Cryville.Crtr {
void InitJudges() {
foreach (var i in _rs.judges) {
var id = i.Key;
judgeMap.Add(id.Key, IdentifierManager.SharedInstance.Request("judge_" + id.Name));
judgeMap.Add(id.Key, IdentifierManager.Shared.Request("judge_" + id.Name));
}
}
static bool _flag;
static readonly PropOp.Boolean _flagop = new PropOp.Boolean(v => _flag = v);
static readonly int _var_fn = IdentifierManager.SharedInstance.Request("fn");
static readonly int _var_tn = IdentifierManager.SharedInstance.Request("tn");
static readonly int _var_ft = IdentifierManager.SharedInstance.Request("ft");
static readonly int _var_tt = IdentifierManager.SharedInstance.Request("tt");
static readonly int _var_fn = IdentifierManager.Shared.Request("judge_clip_from");
static readonly int _var_tn = IdentifierManager.Shared.Request("judge_clip_to");
static readonly int _var_ft = IdentifierManager.Shared.Request("input_time_from");
static readonly int _var_tt = IdentifierManager.Shared.Request("input_time_to");
float _numbuf1, _numbuf2, _numbuf3, _numbuf4;
readonly PropSrc _numsrc1, _numsrc2, _numsrc3, _numsrc4;
unsafe void LoadNum(byte[] buffer, float value) {
@@ -236,7 +236,7 @@ namespace Cryville.Crtr {
void InitScores() {
foreach (var s in _rs.scores) {
var key = s.Key.Key;
var strkey = IdentifierManager.SharedInstance.Request("_score_" + (string)s.Key.Name);
var strkey = IdentifierManager.Shared.Request("_score_" + (string)s.Key.Name);
scoreStringKeys.Add(key, strkey);
scoreStringKeysRev.Add(strkey, key);
scoreSrcs.Add(key, new PropSrc.Float(() => scores[key]));
@@ -262,7 +262,7 @@ namespace Cryville.Crtr {
scoreFullBuf.Clear();
foreach (var s in scores) {
var id = s.Key;
scoreFullBuf.AppendFormat(flag ? "\n{0}: " : "{0}: ", (string)IdentifierManager.SharedInstance.Retrieve(id));
scoreFullBuf.AppendFormat(flag ? "\n{0}: " : "{0}: ", (string)IdentifierManager.Shared.Retrieve(id));
scoreFullBuf.AppendFormat(scoreFormatCache[id], scores[id]);
flag = true;
}