Class PublicDraftState

java.lang.Object
com.hiddenswitch.spellsource.draft.PublicDraftState
All Implemented Interfaces:
Serializable

public class PublicDraftState extends Object implements 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.

See Also:
  • Constructor Details

    • PublicDraftState

      public PublicDraftState()
      Creates a new public draft state that represents a draft that has DraftStatus.NOT_STARTED.
  • Method Details

    • createDeck

      public Deck createDeck()
      Creates a Deck that corresponds to the current deck built by the cards selected in this state.
      Returns:
      A GameDeck instance (usable by a GameContext).
    • getHeroClassChoices

      public List<String> getHeroClassChoices()
      Returns the hero class choices if the draft state is DraftStatus.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

      public void setHeroClassChoices(List<String> heroClassChoices)
    • getCurrentCardChoices

      public List<String> 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

      public void setCurrentCardChoices(List<String> currentCardChoices)
    • getHeroClass

      public String getHeroClass()
      Gets the chosen hero class or null if one has not been chosen yet.
      Returns:
    • setHeroClass

      public void setHeroClass(String heroClass)
    • getStatus

      public DraftStatus getStatus()
      Returns the current status of the draft.
      Returns:
    • setStatus

      public void setStatus(DraftStatus status)
    • getSelectedCards

      public List<String> getSelectedCards()
      Gets a list of card IDs the player has chosen so far.
      Returns:
    • setSelectedCards

      public void setSelectedCards(List<String> selectedCards)
    • 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

      public String getDeckId()
      Gets the CollectionRecord that corresponds to this draft's deck in the net services for Spellsource.
      Returns:
    • setDeckId

      public void setDeckId(String deckId)