Package behaviors

Class BehaviorData

java.lang.Object
behaviors.BehaviorData

public final class BehaviorData extends Object
A singleton to store data that needs to be used at runtime by multiple behaviors.
Since:
2023
  • Constructor Details

    • BehaviorData

      public BehaviorData()
      Initializes all of the variables of the singleton.
  • Method Details

    • getInstance

      public static BehaviorData getInstance()
      Gets an instance of this object and returns it, if it is null it creates an instance of this object. Can also make static method calls to the object itself.
      Returns:
      BehaviorData
    • setCurrentGuess

      public static void setCurrentGuess(char guess)
      Changes the value of currentGuess.
      Parameters:
      guess - character guess
    • getCurrentGuess

      public static char getCurrentGuess()
      Returns the currentGuess.
      Returns:
      char
    • setWordToGuess

      public static void setWordToGuess(String word)
      Changes the current value of wordToGuess.
      Parameters:
      word - word to be guessed
    • getWordToGuess

      public static String getWordToGuess()
      Returns the wordToGuess.
      Returns:
      String
    • setTachoCount

      public static void setTachoCount(int tacho)
      Changes the value of tachoCount.
      Parameters:
      tacho - the tacho count
    • getTachoCount

      public static int getTachoCount()
      Returns the tacho count last put here.
      Returns:
      int
    • setPermanentTachoCount

      public static void setPermanentTachoCount(int tacho)
      Changes the value of the permanenTachoCount.
      Parameters:
      tacho - the tacho count
    • getPermanentTachoCount

      public static int getPermanentTachoCount()
      Returns the permenantTachoCount.
      Returns:
      int
    • setGameWon

      public static void setGameWon(boolean won)
      Changes the value of gameWon.
      Parameters:
      won - boolean of game won
    • getGameWon

      public static boolean getGameWon()
      Returns the whether the game has been won.
      Returns:
      boolean
    • setExititng

      public static void setExititng(boolean exit)
      Changes the value of exit.
      Parameters:
      exit - boolean of game being exited
    • getExiting

      public static boolean getExiting()
      Returns whether or not the program is exiting.
      Returns:
      boolean
    • setTiles

      public static void setTiles(Tile[] tileArray)
      Changes the value of tileArray
      Parameters:
      tileArray - array of tiles
    • getTiles

      public static Tile[] getTiles()
      Returns an array of tiles pertaining to the word.
      Returns:
      Tile[]