Class SlotChoice

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

public class SlotChoice extends NetworkEvent
NetworkEvent to select a slot where to place the player totem.
See Also:
  • Field Details

    • pos

      private final int pos
      Index of the selected slot.
  • Constructor Details

    • SlotChoice

      public SlotChoice(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 selected slot
  • 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 slot choice is handled successfully, false otherwise.
    • apply

      public void apply(MiniModel miniModel)
      Applies this event to the client-side mini model, updating players, turn order, game state, and slot map after a slot selection.
      Specified by:
      apply in class NetworkEvent
      Parameters:
      miniModel - the client-side model to update.