Open CPColin opened 2 months ago
I wonder if we should go as far as to create a new type for this to make coding around it simpler to implement. "TieredSchrodingersStrings" or something.
That could be a good way to make it more clear what the intent is. I'll give it a try!
We've got a few bits of code that do the similar action of searching a
Dictionary<int, SchrodingersString>?
value for the highest key that is less than or equal to a target value:Itemdata.TryGetTrackingResponse()
AutoTracker.IncrementGTItems()
Tracker.TrackDungeonTreasure()
Tracker.CountHyperBeamShots()
Tracker.ClearArea()
(theTrackedNothingOutOfLogic
part)It could be helpful to have an overload of the
TrackerBase.Say()
method that takes aDictionary<int, SchrodingersString>?
value directly and consolidates the logic that picks the matching response.For the last item in the list above, doing this would mean we would no longer need separate
TrackedNothing
andTrackedNothingOutOfLogic
responses, which could potentially mess with custom lines people have written.Per Matt's suggestion below and Vivelin's thumbs-up, we should try to create a type like
TieredSchrodingersString
that we can pass around, instead ofDictionary<int, SchrodingersString>
. We'll have to make sure such a type is still serializable to and from JSON and can still be merged across profiles.Inspired by the code I forgot to write and had to add in #496.