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

[WIP] Set reporting core #629

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

TwilCynder
Copy link
Contributor

@TwilCynder TwilCynder commented Oct 5, 2023

Adding set reporting features, starting with the core API operations and data structures required.

  • Added a TournamentDataModifier, which works just like TournamentDataProvider (with child classes for each bracket provider)
  • Changed TSHTournamentDataProvider to TSHTournamentDataManager -> it is now able to handle both queries and mutations.

What remains to be implemented is the UI part, and more importantly, a way to actually track the current set's and player's IDs, because currently TSH does not have that (except the set ID, which is stuck in the closure of a lambda), which means it is impossible to actually perform the modifications (all my functions take IDs as parameters, but TSh doesn't reaaly have them anywhere) ; which is why this is still WIP.

here are the ideas i've had for that problem, the possible solutions, and the smaller problems they might introduce, if anyone wanna discuss them.

  • Introduce a SetManager class, that keeps track of the current set : set ID and entrant ID for both players. It would be kept as a property of the scoreboard. Currently, this notion kind of already exists in the form of the auto-update feature : when auto-updating is enabled, there is a specific bracket set we are constantly updating form (no matter if we changed the player info after loading from that set). The idea would be to expand this to allow the current set, represented by the SetManager, to be either :
    • Nonexistent : The current match is not linked to a specific bracket match;
    • Linked : The current set is linked to a bracket match -> This object contains all the IDs required to update the score from TSH to startgg.
    • Updating : Same but auto-updating (see below)
      Auto-updating would most mikely depend on the SetManager : maybe it could simply keep the SetManager in its closure instead of having the set ID directly.
  • Reporting characters and stages requires keeping track of each game. It could be done by the SetManager, or by a separate ScoreManager (which will be done in a separate PR)
  • The game reporting process would be :
    • A button in the scoreboard is clicked
    • Call TSHTournamentDataManager.instance.ReportGame with the SetManager/GamesManager as an argument. This method opens a dialog that lets the user select who won, characters, and if the set is completed after this game.
    • If the user validates, save the game info in GamesManager
    • If the user validated, call TSHTournamentDataManager.instance.SetSetGames, which actually does the API call

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