Draft
Conversation
With draft bag queues, bags are passed as soon as players are done with them. If there's no queued bags waiting for that player, then they temporarily have no current bag at all. Using Optional for getCurrentBag() so that the compiler catches this change's downstream effects.
Haven't considered migration strategies. Probably going to have to restore some of the old code to deal with that.
This shouldn't happen, unless an old button persisted too long or something.
This eliminates the case where current bag is null but the queue is not empty, which should never occur but required error handling code.
To disambiguate the "item queue" (items to be drafted from the current bag) from the "bag queue" (bags to be drafted from).
This replaces the command to force pass all players' bags.
Fixes an issue where `/franken franken_edit` didn't print new bags or update the status message after forcing a pass.
Avoids a race that could cause the new bag messages to display the old selections.
Accidentally passed them to the left.
Contributor
Author
Contributor
Author
|
Implementing a choice of queueing or non-queueing drafts is complicated a little by the presence of the various |
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.

Still working on this, but most of the functionality is there.
Goal
Pass bags as soon as players are done with them, and allow them to queue up for the next player.
Implementation
Game state
Player#currentDraftBagis now a queue of draft bags, the 0th of which is the current bag. Serializes as a list separated by semicolons.Player#readyToPassBagis removed.Game behaviors
The core logic is moved from
BagDraft#passBags()to a trio of functions,void passBag(Player),DraftBag dequeueBag(Player), andvoid enqueueBag(Player, DraftBag), which call eachother as necessary. A lot of the message-printing moves from theFrankenButtonHandlers into those functions as well, since the process is a bit more complicated now.UI
Current draft looks something like:

Indicates how many bags are with each player.
Would it be helpful to display some information about each bag? An arbitrary name, or a count of remaining items?
Other stuff
The existing concept of "draft queues", referring to the items a player is in the process of choosing from their current bag, is renamed to "selections" throughout. This is for the sake of being able to read the code >_<
TODO
Open questions:
readyToPassBagand if so, pass it), but is confusing.Remaining work: