# Class Gameboard

java.lang.Object
it.polimi.ingsw.is25am31.model.gameboard.Gameboard

All Implemented Interfaces:
  `Serializable`

public class Gameboard extends Object implements Serializable
The Gameboard class represents the board used in the game, containing a specified number of boxes based on the game level. It keeps track of player rockets and their positions on the board.

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Gameboard(int level)`
  Constructs a gameboard with a specified difficulty level

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getBoxes()`
  Returns the total number of boxes on the board
  `int`
  `getLevel()`
  Returns the difficulty level of the board
  `Map<Rocket,Integer>`
  `getRockets()`
  Retrieves the mapping of all rockets to their positions
  `void`
  `removeRockets(Rocket rocket)`
  Removes a rocket's registration from the board
  `void`
  `setRockets(int position, Rocket rocket)`
  Registers or updates a rocket's position on the board

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

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

- ## Constructor Details

  - ### Gameboard

    public Gameboard(int level)
    Constructs a gameboard with a specified difficulty level
    Parameters:
      `level` - difficulty level (1 or 2)

- ## Method Details

  - ### getLevel

    public int getLevel()
    Returns the difficulty level of the board
    Returns:
      level of the gameboard

  - ### getBoxes

    public int getBoxes()
    Returns the total number of boxes on the board
    Returns:
      number of boxes available

  - ### setRockets

    public void setRockets(int position, Rocket rocket)
    Registers or updates a rocket's position on the board
    Parameters:
      `position` - index of the box where the rocket is placed
      `rocket` - Rocket instance to register

  - ### getRockets

    public Map<Rocket,Integer> getRockets()
    Retrieves the mapping of all rockets to their positions
    Returns:
      map of rockets and their board positions

  - ### removeRockets

    public void removeRockets(Rocket rocket)
    Removes a rocket's registration from the board
    Parameters:
      `rocket` - Rocket instance to remove