Package behaviors
Class BehaviorData
java.lang.Object
behaviors.BehaviorData
A singleton to store data that needs to be used at runtime by multiple behaviors.
- Since:
- 2023
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic charReturns the currentGuess.static booleanReturns whether or not the program is exiting.static booleanReturns the whether the game has been won.static BehaviorDataGets an instance of this object and returns it, if it is null it creates an instance of this object.static intReturns the permenantTachoCount.static intReturns the tacho count last put here.static Tile[]getTiles()Returns an array of tiles pertaining to the word.static StringReturns the wordToGuess.static voidsetCurrentGuess(char guess) Changes the value of currentGuess.static voidsetExititng(boolean exit) Changes the value of exit.static voidsetGameWon(boolean won) Changes the value of gameWon.static voidsetPermanentTachoCount(int tacho) Changes the value of the permanenTachoCount.static voidsetTachoCount(int tacho) Changes the value of tachoCount.static voidChanges the value of tileArraystatic voidsetWordToGuess(String word) Changes the current value of wordToGuess.
-
Constructor Details
-
BehaviorData
public BehaviorData()Initializes all of the variables of the singleton.
-
-
Method Details
-
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
Changes the current value of wordToGuess.- Parameters:
word- word to be guessed
-
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
Changes the value of tileArray- Parameters:
tileArray- array of tiles
-
getTiles
Returns an array of tiles pertaining to the word.- Returns:
- Tile[]
-