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
-
Method Summary
Modifier and TypeMethodDescriptionstatic char
Returns the currentGuess.static boolean
Returns whether or not the program is exiting.static boolean
Returns the whether the game has been won.static BehaviorData
Gets an instance of this object and returns it, if it is null it creates an instance of this object.static int
Returns the permenantTachoCount.static int
Returns the tacho count last put here.static Tile[]
getTiles()
Returns an array of tiles pertaining to the word.static String
Returns the wordToGuess.static void
setCurrentGuess
(char guess) Changes the value of currentGuess.static void
setExititng
(boolean exit) Changes the value of exit.static void
setGameWon
(boolean won) Changes the value of gameWon.static void
setPermanentTachoCount
(int tacho) Changes the value of the permanenTachoCount.static void
setTachoCount
(int tacho) Changes the value of tachoCount.static void
Changes the value of tileArraystatic void
setWordToGuess
(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[]
-