# Class CrewSelectionController

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

public class CrewSelectionController extends Object
Controller for the crew selection phase of the game. Manages the placement of crew members and aliens on the spaceship grid, displays the ship components with their current state, and handles user interactions for placing different types of crew members.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CrewSelectionController()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `javafx.scene.control.Label`
  `getMessageLabel()`
  Gets the message label component.
  `javafx.stage.Stage`
  `getStage()`
  Gets the stage associated with this controller.
  `void`
  `setGui(Gui gui)`
  Sets the GUI instance for this controller.
  `void`
  `setGuiRenderer(GuiRenderer guiRenderer)`
  Sets the GUI renderer for this controller.
  `void`
  `setLevel(int level)`
  Sets the ship level for display purposes.
  `void`
  `setServerAndClient(VirtualServer server, ClientModel client)`
  Sets the virtual server and client model for this controller.
  `void`
  `setStage(javafx.stage.Stage stage)`
  Sets the stage associated with this controller.
  `void`
  `showShip(Ship ship)`
  Displays the ship on the UI by loading component images and updating the view.

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

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

- ## Constructor Details

  - ### CrewSelectionController

    public CrewSelectionController()

- ## Method Details

  - ### setGui

    public void setGui(Gui gui)
    Sets the GUI instance for this controller.
    Parameters:
      `gui` - the GUI instance to set

  - ### setServerAndClient

    public void setServerAndClient(VirtualServer server, ClientModel client)
    Sets the virtual server and client model for this controller.
    Parameters:
      `server` - the virtual server instance for network communication
      `client` - the client model containing game state information

  - ### showShip

    public void showShip(Ship ship)
    Displays the ship on the UI by loading component images and updating the view.
    Parameters:
      `ship` - the ship to be displayed

  - ### setLevel

    public void setLevel(int level)
    Sets the ship level for display purposes.
    Parameters:
      `level` - the ship level (1 or 2)

  - ### getMessageLabel

    public javafx.scene.control.Label getMessageLabel()
    Gets the message label component.
    Returns:
      the message label

  - ### setGuiRenderer

    public void setGuiRenderer(GuiRenderer guiRenderer)
    Sets the GUI renderer for this controller.
    Parameters:
      `guiRenderer` - the GUI renderer instance

  - ### setStage

    public void setStage(javafx.stage.Stage stage)
    Sets the stage associated with this controller.
    Parameters:
      `stage` - the JavaFX stage

  - ### getStage

    public javafx.stage.Stage getStage()
    Gets the stage associated with this controller.
    Returns:
      the JavaFX stage