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 int
The number of cards per round the player will choose from.static int
Indicates the number of rounds of choices the user will make amongCARDS_PER_ROUND
options 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.void
Begins a draft, initializing thePublicDraftState
on the context and notifying the behaviour that the state has changed.boolean
Is the draft over?protected void
requireDraftStatus
(DraftStatus requiredStatus) void
selectCard
(int choiceIndex) Selects a card from teh current choice index.void
startDraft
(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_ROUND
options to build a deck for a draft.
-
-
Constructor Details
-
Method Details
-
initializeDraft
public void initializeDraft()Begins a draft, initializing thePublicDraftState
on 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:
true
if 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.
-