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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.getState()
Returns the current game state.getTiles()
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
-
Field Details
-
ITEM_WIDTH
public static final float ITEM_WIDTH- See Also:
-
ITEM_HEIGHT
public static final float ITEM_HEIGHT- See Also:
-
-
Constructor Details
-
Board
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 classcom.badlogic.gdx.scenes.scene2d.Actor
- Parameters:
batch
- the sprite batch to render toparentAlpha
- the parent alpha value
-
getState
Returns the current game state.- Returns:
- the game state
-
getTiles
Returns a list of tiles on the game board.- Returns:
- the list of tiles
-
getGameState
Returns the game state object.- Returns:
- the game state object
-
getBoardListener
Returns the board listener associated with this board.- Returns:
- the board listener
-
isDisabled
public boolean isDisabled()- Specified by:
isDisabled
in interfacecom.badlogic.gdx.scenes.scene2d.utils.Disableable
-
setDisabled
public void setDisabled(boolean isDisabled) - Specified by:
setDisabled
in interfacecom.badlogic.gdx.scenes.scene2d.utils.Disableable
-