Added always show self and preventing cache change#2
Merged
Tischel merged 3 commits intoTischel:mainfrom Feb 3, 2024
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This merge accomplishes 2 front facing things and a few more backend related things:
Now some more information as to what was involved in adding these things:
We were using our source of truth (will be refered to as SoT) as a cache point which is fine in essence nothing was changed here but it creates the issue that if we mutate the returned cached list/objects our SoT will be corrupted.
This wasn't bad with the initial feature set aside from a single point, more on that in a bit but if we want to make changes into how we render said information without corrupting the SoT would be relatively impossible.
This is alleviated by creating a copy of the list when we grab the cached source of truth and using that for all our render specific changes.
The downside to this is that we don't create a deep copy so all the objects inside of the list will still be able to be corrupted but for this change I found that we can postpone fixing that until absolutely necessary to fix.
The other thing we had to change was the combatants data. We were overwriting the combatants SoT
Namefield inside of a Draw method (this is all kinds of bad but I digress). To alleviate this I moved the Name field's deserialization to a backing field namedOriginalNameand creating a new fieldNameOverwriteand a new propertyNameto replace our lost field, the property is an expression body that returns the overwrite to the name or the original name. The original name being our SoT and being forwarded to us from ACT.Now that had a ripple effect of not working due to our Tag system only supporting fields, I have changed our Tag system to support both Fields and Properties, so that maybe in the future we can use expression type properties instead of
LazyStrings.Lazystringsin the current implementation showcase a big problem, namely there is no cache invalidation. This was out of scope to add for this PR so I left that as it was to begin with.