Class PublicDraftState
java.lang.Object
com.hiddenswitch.spellsource.draft.PublicDraftState
- All Implemented Interfaces:
Serializable
Public information about the player's draft.
This information contains no secret information the player could cheat with. It also includes the win and loss history.
By default, the draft status is initialized to DraftStatus.NOT_STARTED
.
The public draft state is populated by the DraftLogic
. Use a DraftContext
to populate the state.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new public draft state that represents a draft that hasDraftStatus.NOT_STARTED
. -
Method Summary
Modifier and TypeMethodDescriptionCreates aDeck
that corresponds to the current deck built by the cards selected in this state.int
Gets how many cards remain to be chosen.Gets the current card choices for the current round of the draft, or an empty list if there are no choices, the draft is over or otherwise the state is not valid for choosing cards.Gets theCollectionRecord
that corresponds to this draft's deck in thenet
services for Spellsource.int
Returns the current round.Gets the chosen hero class ornull
if one has not been chosen yet.Returns the hero class choices if the draft state isDraftStatus.SELECT_HERO
, or an empty list if there are no choices, the choice has already been made, or the state is not valid for choosing heroes.int
Gets the number of losses the player has had with the currently drafted deck.Gets a list of card IDs the player has chosen so far.Returns the current status of the draft.int
getWins()
Gets the number of wins the player has had with the currently drafted deck.void
setCardsRemaining
(int cardsRemaining) void
setCurrentCardChoices
(List<String> currentCardChoices) void
void
setDraftIndex
(int draftIndex) void
setHeroClass
(String heroClass) void
setHeroClassChoices
(List<String> heroClassChoices) void
setLosses
(int losses) void
setSelectedCards
(List<String> selectedCards) void
setStatus
(DraftStatus status) void
setWins
(int wins)
-
Constructor Details
-
PublicDraftState
public PublicDraftState()Creates a new public draft state that represents a draft that hasDraftStatus.NOT_STARTED
.
-
-
Method Details
-
createDeck
Creates aDeck
that corresponds to the current deck built by the cards selected in this state.- Returns:
- A
GameDeck
instance (usable by aGameContext
).
-
getHeroClassChoices
Returns the hero class choices if the draft state isDraftStatus.SELECT_HERO
, or an empty list if there are no choices, the choice has already been made, or the state is not valid for choosing heroes.- Returns:
-
setHeroClassChoices
-
getCurrentCardChoices
Gets the current card choices for the current round of the draft, or an empty list if there are no choices, the draft is over or otherwise the state is not valid for choosing cards.- Returns:
-
setCurrentCardChoices
-
getHeroClass
Gets the chosen hero class ornull
if one has not been chosen yet.- Returns:
-
setHeroClass
-
getStatus
Returns the current status of the draft.- Returns:
-
getSelectedCards
Gets a list of card IDs the player has chosen so far.- Returns:
-
setSelectedCards
-
getCardsRemaining
public int getCardsRemaining()Gets how many cards remain to be chosen.- Returns:
-
setCardsRemaining
public void setCardsRemaining(int cardsRemaining) -
getDraftIndex
public int getDraftIndex()Returns the current round.- Returns:
-
setDraftIndex
public void setDraftIndex(int draftIndex) -
getWins
public int getWins()Gets the number of wins the player has had with the currently drafted deck.- Returns:
-
setWins
public void setWins(int wins) -
getLosses
public int getLosses()Gets the number of losses the player has had with the currently drafted deck.- Returns:
-
setLosses
public void setLosses(int losses) -
getDeckId
Gets theCollectionRecord
that corresponds to this draft's deck in thenet
services for Spellsource.- Returns:
-
setDeckId
-