Class GameConstants

java.lang.Object
com.slinky.hackmaster.model.GameConstants

public class GameConstants extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    static final javafx.scene.paint.Color
    The color for the game's background
    static final int
    The constant height of the cell view in pixels.
    static final int
    The constant width of the cell view in pixels.
    static final javafx.scene.text.Font
    The Font object representing the font used in the application.
    static final int
    The default font size used for the Font object in the application.
    static final javafx.scene.paint.Color
    The main foreground to be used throughout the game.
    static final int
    The number of guesses the user starts with.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Methods inherited from class java.lang.Object

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

    • STARTING_GUESSES

      public static final int STARTING_GUESSES
      The 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_SIZE
      The default font size used for the Font object 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 FONT
      The Font object 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 specified FONT_SIZE.
    • FOREGROUND

      public static final javafx.scene.paint.Color FOREGROUND
      The main foreground to be used throughout the game.
    • BACKGROUND

      public static final javafx.scene.paint.Color BACKGROUND
      The color for the game's background
    • CELL_WIDTH

      public static final int CELL_WIDTH
      The constant width of the cell view in pixels. This defines the preferred width of the CellView when displayed in the user interface.
      See Also:
    • CELL_HEIGHT

      public static final int CELL_HEIGHT
      The constant height of the cell view in pixels. This defines the preferred height of the CellView when displayed in the user interface.
      See Also:
  • Constructor Details

    • GameConstants

      public GameConstants()