Class Board

java.lang.Object
com.badlogic.gdx.scenes.scene2d.Actor
dev.plagarizers.klotski.gui.actors.Board
All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.utils.Disableable

public class Board extends com.badlogic.gdx.scenes.scene2d.Actor implements com.badlogic.gdx.scenes.scene2d.utils.Disableable
The `Board` class represents a game board that extends the `Actor` class. It is responsible for rendering the game board, managing the game state, and handling user input.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final float
     
    static final float
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Board(Level level)
    Constructs a new `Board` object with the specified initial state and label style.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    draw(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha)
    Renders the game board and its components.
    Returns the board listener associated with this board.
    Returns the game state object.
    Returns the current game state.
    Returns a list of tiles on the game board.
    boolean
     
    void
    setDisabled(boolean isDisabled)
     

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor

    act, addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clear, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebug, drawDebugBounds, fire, firstAscendant, getActions, getCaptureListeners, getColor, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasActions, hasKeyboardFocus, hasParent, hasScrollFocus, hit, isAscendantOf, isDescendantOf, isTouchable, isTouchFocusListener, isTouchFocusTarget, isVisible, localToActorCoordinates, localToAscendantCoordinates, localToParentCoordinates, localToScreenCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, scaleChanged, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setStage, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, sizeChanged, stageToLocalCoordinates, toBack, toFront, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • Board

      public Board(Level level)
      Constructs a new `Board` object with the specified initial state and label style.
      Parameters:
      level - the initial game state
  • Method Details

    • draw

      public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha)
      Renders the game board and its components.
      Overrides:
      draw in class com.badlogic.gdx.scenes.scene2d.Actor
      Parameters:
      batch - the sprite batch to render to
      parentAlpha - the parent alpha value
    • getState

      public State getState()
      Returns the current game state.
      Returns:
      the game state
    • getTiles

      public List<Tile> getTiles()
      Returns a list of tiles on the game board.
      Returns:
      the list of tiles
    • getGameState

      public GameState getGameState()
      Returns the game state object.
      Returns:
      the game state object
    • getBoardListener

      public BoardListener getBoardListener()
      Returns the board listener associated with this board.
      Returns:
      the board listener
    • isDisabled

      public boolean isDisabled()
      Specified by:
      isDisabled in interface com.badlogic.gdx.scenes.scene2d.utils.Disableable
    • setDisabled

      public void setDisabled(boolean isDisabled)
      Specified by:
      setDisabled in interface com.badlogic.gdx.scenes.scene2d.utils.Disableable