# Class WaitingRoomController

java.lang.Object
it.polimi.ingsw.is25am31.view.gui.WaitingRoomController

public class WaitingRoomController extends Object
Controller for the waiting room between game phases. Manages rocket position selection for level 2 games and displays/controls the hourglass timer system. Handles the transition between assembly phase and flight phase while players wait for others to complete their actions.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `WaitingRoomController()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `javafx.scene.control.Label`
  `getErrorLabel()`
  Gets the error label component.
  `void`
  `setCount(int count, int seconds)`
  Sets the timer count and configures the timer button behavior.
  `void`
  `setServerAndClient(VirtualServer server, ClientModel client)`
  Sets the server and client model for this controller.
  `void`
  `unlockPositionField()`
  Unlocks the position input field and button.
  `void`
  `updateTimer(int counter, int seconds)`
  Updates the timer display and starts the countdown.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### WaitingRoomController

    public WaitingRoomController()

- ## Method Details

  - ### setServerAndClient

    public void setServerAndClient(VirtualServer server, ClientModel client)
    Sets the server and client model for this controller. Configures the UI based on the game level (shows position selection for level 2).
    Parameters:
      `server` - the virtual server for network communication
      `client` - the client model containing game state

  - ### setCount

    public void setCount(int count, int seconds)
    Sets the timer count and configures the timer button behavior. Handles different timer phases and continues countdown if already in progress.
    Parameters:
      `count` - the current timer count (0-4)
      `seconds` - the remaining seconds if timer is already running

  - ### updateTimer

    public void updateTimer(int counter, int seconds)
    Updates the timer display and starts the countdown.
    Parameters:
      `counter` - the current timer count
      `seconds` - the seconds remaining (not used in this implementation)

  - ### getErrorLabel

    public javafx.scene.control.Label getErrorLabel()
    Gets the error label component.
    Returns:
      the error label

  - ### unlockPositionField

    public void unlockPositionField()
    Unlocks the position input field and button. Uses Platform.runLater for thread-safe UI updates.