Class DrawUpperTribeCard

java.lang.Object
it.polimi.ingsw.gc14.Network.NetworkEvent
it.polimi.ingsw.gc14.Network.NetworkEvents.DrawUpperTribeCard
All Implemented Interfaces:
Serializable

public class DrawUpperTribeCard extends NetworkEvent
NetworkEvent to draw a tribe card from the upper card list.
See Also:
  • Field Details

    • pos

      private final int pos
      Index of the card to draw
  • Constructor Details

    • DrawUpperTribeCard

      public DrawUpperTribeCard(String username, int pos)
      Class constructor. Initializes all the attributes.
      Parameters:
      username - the name of the player requesting the event
      pos - the index of the card to draw
  • Method Details

    • apply

      public boolean apply(GameController gameController)
      Description copied from class: NetworkEvent
      Applies this event to the specified server-side game controller.
      Specified by:
      apply in class NetworkEvent
      Parameters:
      gameController - the Game Controller on which to apply the event
      Returns:
      true if the player could draw the card, false otherwise
    • apply

      public void apply(MiniModel miniModel)
      Applies this event to the client-side mini model, removing the drawn card from the upper tribe list and updating players, turn order, game state, and slot map.
      Specified by:
      apply in class NetworkEvent
      Parameters:
      miniModel - the client-side model to update.