Interface DraftBehaviour

All Known Implementing Classes:
NullDraftBehaviour

public interface DraftBehaviour
Describes a behaviour during a draft. This helps implementing drafting mechanics in Spellsource and is implemented by the appropriate networking code to proxy a user in the Unity client.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    chooseCardAsync(List<String> cards, io.vertx.core.Handler<io.vertx.core.AsyncResult<Integer>> selectedCardIndex)
    Given a list of cards, choose one card.
    void
    chooseHeroAsync(List<String> classes, io.vertx.core.Handler<io.vertx.core.AsyncResult<String>> result)
    Given a list of champions, which champion will this draft be?
    void
    Notifies the behaviour of the current public draft state as soon as it changes.
    void
    notifyDraftStateAsync(PublicDraftState state, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> acknowledged)
    Notifies the behaviour of the current public draft state as soon as it changes, and receives a callback when the client has acknowledged receipt of the data.
  • Method Details

    • chooseHeroAsync

      void chooseHeroAsync(List<String> classes, io.vertx.core.Handler<io.vertx.core.AsyncResult<String>> result)
      Given a list of champions, which champion will this draft be?
      Parameters:
      classes - Some number of champions.
      result - Called with the chosen champion.
    • chooseCardAsync

      void chooseCardAsync(List<String> cards, io.vertx.core.Handler<io.vertx.core.AsyncResult<Integer>> selectedCardIndex)
      Given a list of cards, choose one card. This card is typically added to the deck.
      Parameters:
      cards - A list of choices currently.
      selectedCardIndex - Called with the index of the choice.
    • notifyDraftState

      void notifyDraftState(PublicDraftState state)
      Notifies the behaviour of the current public draft state as soon as it changes.
      Parameters:
      state - The state
    • notifyDraftStateAsync

      void notifyDraftStateAsync(PublicDraftState state, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> acknowledged)
      Notifies the behaviour of the current public draft state as soon as it changes, and receives a callback when the client has acknowledged receipt of the data.
      Parameters:
      state - The state
      acknowledged - Called when the state was received (written to the network socket in practice).