java.lang.Object
com.slinky.hackmaster.model.GameConstants
The
GameConstants class defines a set of constants used throughout
the game application. These constants include the starting number of guesses
a player has, the default font size for text rendering, and the Font
object used within the application's UI.
This class is designed to centralise these key configuration values, ensuring they are consistently used across the application and can be easily referenced or modified if needed (except for final fields which are immutable).
This class is not meant to be instantiated, but rather serves as a convenient container for game-related constants that are commonly referenced in the application's logic and UI components.
- Author:
- Kheagen Haskins
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final javafx.scene.paint.ColorThe color for the game's backgroundstatic final intThe constant height of the cell view in pixels.static final intThe constant width of the cell view in pixels.static final javafx.scene.text.FontTheFontobject representing the font used in the application.static final intThe default font size used for theFontobject in the application.static final javafx.scene.paint.ColorThe main foreground to be used throughout the game.static final intThe number of guesses the user starts with. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
STARTING_GUESSES
public static final int STARTING_GUESSESThe number of guesses the user starts with. This value is set to 4 and is a constant throughout the game.- See Also:
-
FONT_SIZE
public static final int FONT_SIZEThe default font size used for theFontobject in the application. This size is set to 16 by default and cannot be changed as it is a final field.- See Also:
-
FONT
public static final javafx.scene.text.Font FONTTheFontobject representing the font used in the application. This font is loaded from the resources if available, otherwise it defaults to a monospaced font with the specifiedFONT_SIZE. -
FOREGROUND
public static final javafx.scene.paint.Color FOREGROUNDThe main foreground to be used throughout the game. -
BACKGROUND
public static final javafx.scene.paint.Color BACKGROUNDThe color for the game's background -
CELL_WIDTH
public static final int CELL_WIDTHThe constant width of the cell view in pixels. This defines the preferred width of theCellViewwhen displayed in the user interface.- See Also:
-
CELL_HEIGHT
public static final int CELL_HEIGHTThe constant height of the cell view in pixels. This defines the preferred height of theCellViewwhen displayed in the user interface.- See Also:
-
-
Constructor Details
-
GameConstants
public GameConstants()
-