User:Gregory Gauthier/JAGUARS++ design

From QBWiki
Jump to navigation Jump to search

These are design notes for JAGUARS++, a proposed rewrite of JAGUARS in C++. The Qt framework will still be used, but the overall design of the program will change.

The main class will be a GameManager which runs a game by handling commands. It sends responses to the moderator console. It also emits messages that may be of interest to other listeners as well. For example, it may notify of a score change in case a scoreboard window wants to be aware of it. The other key difference from JAGUARS is that the GameManager will store a stack of commands, so that it can intelligently roll back the game in case of moderator error or protest. Derived classes can be tailored to specific formats and kinds of formats; as an example, one inheritance structure might be the following:

  • GameManager
    • TUBonusGameManager
      • ACFGameManager
      • NAQTGameManager
      • IHSAGameManager
    • TossupGameManager
      • HistoryBeeGameManager
      • NTAEGameManager
    • HistoryBowlGameManager

GameManager implementation details

Commands

These are classified into two groups: essential commands (a moderator will likely use these every game) and advanced commands (infrequently-used commands that are still necessary in some games or to ensure that errors can be corrected).

Essential commands

START
Start the game. Parameters (to be determined) will be passed to the GM in this command (for example: what are the teams, who will be sitting in which buzzer position, what packet is going to be used, etc.)
PROCEED
Continue the game after an intermission/
BUZZ pos
Register that the player in the game position has attempted to trigger the lockout system.
RIGHT [points]
Tell the GM that the player who has buzzed in answered correctly. The optional points value indicates the number of points to be awarded; this defaults to a GM-set value.
WRONG
Tell the GM that the player who has buzzed in answered incorrectly, but no points are to be deducted (the system will be reset and positions on the same team will be locked out).
NEG
Tell the GM that the player who has buzzed in answered incorrectly and should be assessed a neg (the system will be reset and positions on the same team will be locked out).
ENDTOSSUP
Tell the GM that the tossup has ended with no further buzzes.
BONUS points
Tell the GM that the team in control of a bonus has received the given number of points.
SUBSTITUTE pos playerid
Remove the player in the given position and replace that position by the player with the given playerid.

Advanced commands

BUZZERCHECK
Enter the buzzer check state.
PROTEST memo
Store a protest about the current question with the given memo.
CONFER pos
Register that the player in the given position was responsible for illegal conferring during a toss-up question. This is different from ruling neg, as the player who conferred receives a -5, not the player who actually buzzed in (see ACF rules E.5 and E.13). (TODO: handle conferring after the question is finished, which does not earn a -5)
AMEND
Replace one event in the stack with another (TODO: details)
UNDO
Remove the top command on the stack
REDO
Add the most recently undone command, provided that no new commands have been introduced.
REPLACE [qno]
Replace the current question with question qno or the next available question, and forbid the usage of this question again in the match (as, for example, when the moderator accidentally gives away the answer to a live question). Compare SKIPTO.
SKIPTO qno
Set aside this question for later use and use in its place question qno (as, for example, when the moderator reads the questions out of order).
LOCKOUT TEAM teamid; LOCKOUT POSITION pos
Lockout the designated position or team from answering this toss-up question.