From fc8512ff639c98dd1c8b641fc389a9bce02f2011 Mon Sep 17 00:00:00 2001 From: PopSlime Date: Fri, 10 Feb 2023 17:32:59 +0800 Subject: [PATCH] Combine score and score string property sources. --- Assets/Cryville/Crtr/Judge.cs | 8 ++------ Assets/Cryville/Crtr/PdtEvaluator.cs | 4 ---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Assets/Cryville/Crtr/Judge.cs b/Assets/Cryville/Crtr/Judge.cs index 07849c6..e38a238 100644 --- a/Assets/Cryville/Crtr/Judge.cs +++ b/Assets/Cryville/Crtr/Judge.cs @@ -217,7 +217,6 @@ namespace Cryville.Crtr { readonly Dictionary scoreDefs = new Dictionary(); readonly Dictionary scores = new Dictionary(); readonly Dictionary scoreStringCache = new Dictionary(); - readonly Dictionary scoreStringSrcs = new Dictionary(); readonly ArrayPool scoreStringPool = new ArrayPool(); readonly Dictionary scoreFormatCache = new Dictionary(); readonly TargetString scoreFullStr = new TargetString(); @@ -233,21 +232,18 @@ namespace Cryville.Crtr { scoreDefs.Add(key, s.Value); scores.Add(key, s.Value.init); scoreStringCache.Add(scoreStringKeys[key], null); - scoreStringSrcs.Add(scoreStringKeys[key], new ScoreStringSrc(scoreStringPool, () => scores[key], scoreDefs[key].format)); + scoreSrcs.Add(scoreStringKeys[key], new ScoreStringSrc(scoreStringPool, () => scores[key], scoreDefs[key].format)); scoreFormatCache[key] = string.Format("{{0:{0}}}", s.Value.format); } } void InvalidateScore(int key) { scoreSrcs[key].Invalidate(); scoreStringCache[scoreStringKeys[key]] = null; - scoreStringSrcs[scoreStringKeys[key]].Invalidate(); + scoreSrcs[scoreStringKeys[key]].Invalidate(); } public bool TryGetScoreSrc(int key, out PropSrc value) { return scoreSrcs.TryGetValue(key, out value); } - public bool TryGetScoreStringSrc(int key, out PropSrc value) { - return scoreStringSrcs.TryGetValue(key, out value); - } public TargetString GetFullFormattedScoreString() { bool flag = false; scoreFullBuf.Clear(); diff --git a/Assets/Cryville/Crtr/PdtEvaluator.cs b/Assets/Cryville/Crtr/PdtEvaluator.cs index 8e72523..6b55457 100644 --- a/Assets/Cryville/Crtr/PdtEvaluator.cs +++ b/Assets/Cryville/Crtr/PdtEvaluator.cs @@ -44,10 +44,6 @@ namespace Cryville.Crtr { prop.Get(out type, out value); RevokePotentialConstant(); } - else if (ContextJudge != null && ContextJudge.TryGetScoreStringSrc(name, out prop)) { - prop.Get(out type, out value); - RevokePotentialConstant(); - } else { PropSrc result = ContextCascadeLookup(name); if (result != null) {