Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final fixes #124

Merged
merged 30 commits into from
Apr 21, 2024
Merged

Final fixes #124

merged 30 commits into from
Apr 21, 2024

Conversation

sp4ce-cowboy
Copy link
Contributor

@sp4ce-cowboy sp4ce-cowboy commented Apr 20, 2024

Summary

Various bug fixes, optimizations, and improvements. Primarily restructuring Storage to support Firebase's async ops. Also update the player stats page.

image

Completed

  • Generalize storage architecture to support more than just StatisticsDatabase (i.e. Storage Database)
  • Updated PlayerStatsUI to show ranks explicitly, and also show progress until next rank.
  • Updated Storage API to support Remote Database's async operations
  • Restructure Storage to be instance based instead of passing StatisticsDatabase around

Pending

  • Proof-of-concept implementation of dual conflict resolution for storage (code exists already but no way to demo)
  • Cache audio players
  • Consider moving from closures to full async/await
  • Fix swiftlint violations
  • Remove unused code

@sp4ce-cowboy sp4ce-cowboy marked this pull request as ready for review April 21, 2024 10:31
@sp4ce-cowboy sp4ce-cowboy requested a review from zheng-ze April 21, 2024 10:51
Vanessamae23
Vanessamae23 previously approved these changes Apr 21, 2024
Copy link
Contributor

@Vanessamae23 Vanessamae23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just some comments

@@ -30,7 +36,10 @@ class RankingEngine: InferenceEngine, InferenceDataDelegate {
}

var currentKd: Double {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this can be more clear as to what kd means but just a nitpick

@@ -52,4 +52,23 @@ final class TotalGamesStatistic: Statistic {
self.init(permanentValue: value, currentValue: current, maxCurrentValue: max)
}

func merge<T: Statistic>(with that: T) -> T? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function has multiple repetition

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, initially I tried to have a default implementation within Statistics, however, StatisticsDatabase is unable to use the merge function when done that way due to some incompatibility with the (any Statistic.Type) Metatype or something. This is the most robust workaround I found.

TowerForge/TowerForge/Metrics/Statistics/Statistic.swift Outdated Show resolved Hide resolved
Copy link
Contributor

@Vanessamae23 Vanessamae23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sp4ce-cowboy sp4ce-cowboy merged commit 719312f into cs3217-2324:main Apr 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants