Class DraftLogic
java.lang.Object
com.hiddenswitch.spellsource.draft.DraftLogic
Implements a basic draft where the user is given a selection of champions from all
DeckFormat.spellsource()
champions, and 30 rounds of 3-card choices pulled from a weighted selection of DeckFormat.spellsource()
catalogue cards.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intThe number of cards per round the player will choose from.static intIndicates the number of rounds of choices the user will make amongCARDS_PER_ROUNDoptions to build a deck for a draft. -
Constructor Summary
ConstructorsConstructorDescriptionDraftLogic(DraftContext context) Creates an instance associated weakly with the specified context. -
Method Summary
Modifier and TypeMethodDescriptionGets a list of card choices currently available to the player.Gets a reference to the draft context.voidBegins a draft, initializing thePublicDraftStateon the context and notifying the behaviour that the state has changed.booleanIs the draft over?protected voidrequireDraftStatus(DraftStatus requiredStatus) voidselectCard(int choiceIndex) Selects a card from teh current choice index.voidstartDraft(String heroClass) Starts the draft given the choice of the specified hero class.
-
Field Details
-
CARDS_PER_ROUND
public static int CARDS_PER_ROUNDThe number of cards per round the player will choose from. -
ROUNDS
public static int ROUNDSIndicates the number of rounds of choices the user will make amongCARDS_PER_ROUNDoptions to build a deck for a draft.
-
-
Constructor Details
-
Method Details
-
initializeDraft
public void initializeDraft()Begins a draft, initializing thePublicDraftStateon the context and notifying the behaviour that the state has changed. -
startDraft
Starts the draft given the choice of the specified hero class.- Parameters:
heroClass-
-
selectCard
public void selectCard(int choiceIndex) Selects a card from teh current choice index.- Parameters:
choiceIndex-- Throws:
InvalidDraftCardSelectionException- if the choice does not exist or the state is invalid.
-
isDraftOver
public boolean isDraftOver()Is the draft over?- Returns:
trueif the number of cards remaining is equal to 0.
-
getContext
Gets a reference to the draft context. Held weakly by this instance.- Returns:
-
getCardChoices
Gets a list of card choices currently available to the player.- Returns:
- The choices, or
Collections.emptyList()if there are none.
-