java.lang.Object
com.example.project.models.gameScreens.GameScreenModel
com.example.project.models.gameScreens.LevelModel
Represents the level model.
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.ReadOnlyIntegerProperty
javafx.beans.property.ReadOnlyIntegerProperty
-
Field Summary
Fields inherited from class com.example.project.models.gameScreens.GameScreenModel
logger, session
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addToCombo
(LetterTile tile) add combo sum and multiCombo TODO: this will changed when implementing modifiersint
TODO: adding modifiersjavafx.beans.property.ReadOnlyIntegerProperty
gets the current plays.javafx.beans.property.ReadOnlyIntegerWrapper
gets the redraws property.Gets the current word formed by tiles in the word areaint
gets the hand size.javafx.beans.property.ReadOnlyBooleanProperty
gets the redraw property.int
gets points need to win the current level.int
gets the max word size.javafx.beans.property.ReadOnlyIntegerProperty
javafx.beans.property.ReadOnlyListProperty
<LetterTile> gets the redraw window size (number of slots in the window).javafx.beans.property.ReadOnlyListProperty
<LetterTile> Gets the tile score sound effect player.javafx.beans.property.ReadOnlyListProperty
<UpgradeTile> gets the upgrades tiles observable property.javafx.beans.property.ReadOnlyListProperty
<LetterTile> boolean
hasLost()
true if player has lostboolean
hasWon()
returns true if player has won.boolean
returns true if word is in dictionary.void
Called when the level has been lost.void
Called when level has been won.void
clears the word row tiles.void
redraws tiles into the tile rack and removes from redraw window.void
resets counts for sum and multi in combovoid
sends the selected redraw tiles back to the rackvoid
setTotalScore
(int totalScore) void
Initialise new level.void
changes active redraw statusboolean
tryMoveTile
(LetterTile tile) determines where tile should go and moves itboolean
Attempts to move a tile from rack to redraw areajavafx.beans.property.ReadOnlyIntegerProperty
javafx.beans.property.ReadOnlyIntegerProperty
-
Property Details
-
wordPoints
public javafx.beans.property.ReadOnlyIntegerProperty wordPointsProperty- See Also:
-
wordMulti
public javafx.beans.property.ReadOnlyIntegerProperty wordMultiProperty- See Also:
-
-
Constructor Details
-
LevelModel
- Parameters:
session
- game session.
-
-
Method Details
-
getTileScoreSoundPlayer
Gets the tile score sound effect player.- Returns:
- LevelTileScoreSoundPlayer.
-
getWordRowTilesProperty
- Returns:
- Read-only list of tiles currently in the word area
-
getTileRackRowTilesProperty
- Returns:
- Read-only list of tiles currently in the rack
-
getRedrawRowTilesProperty
- Returns:
- Read-only list of tiles currently in the redraw window.
-
getPlayersTotalPoints
public javafx.beans.property.ReadOnlyIntegerProperty getPlayersTotalPoints()- Returns:
- the total points property to observe.
-
wordPointsProperty
public javafx.beans.property.ReadOnlyIntegerProperty wordPointsProperty()- Returns:
- the sum combo points property to observe.
-
wordMultiProperty
public javafx.beans.property.ReadOnlyIntegerProperty wordMultiProperty()- Returns:
- the multi combo points property to observe.
-
getIsRedrawActive
public javafx.beans.property.ReadOnlyBooleanProperty getIsRedrawActive()gets the redraw property.- Returns:
- returns indication if redraw active.
-
getCurrentRedraws
public javafx.beans.property.ReadOnlyIntegerWrapper getCurrentRedraws()gets the redraws property.- Returns:
- the current redraws.
-
getCurrentPlays
public javafx.beans.property.ReadOnlyIntegerProperty getCurrentPlays()gets the current plays.- Returns:
- current plays remaining.
-
getUpgradeTilesProprety
gets the upgrades tiles observable property.- Returns:
- the user's session upgrade tiles.
-
getMaxWordSize
public int getMaxWordSize()gets the max word size.- Returns:
- int.
-
getLevelRequirement
public int getLevelRequirement()gets points need to win the current level.- Returns:
- points need to win the current level.
-
getHandSize
public int getHandSize()gets the hand size.- Returns:
- int.
-
getRedrawWindowSize
gets the redraw window size (number of slots in the window).- Returns:
- int.
-
onLostLevel
public void onLostLevel()Called when the level has been lost. resets the players session info and logs back out to the login screen. -
onWonLevel
public void onWonLevel()Called when level has been won. reset the per level info: redraws plays. Goes to shop window. -
hasWon
public boolean hasWon()returns true if player has won.- Returns:
- value indicating if player has won.
-
hasLost
public boolean hasLost()true if player has lost- Returns:
- value indicating if player has lost.
-
tryMoveTileToRedrawArea
Attempts to move a tile from rack to redraw area- Parameters:
tile
- The tile to move- Returns:
- true if move was successful, false otherwise
-
tryMoveTile
determines where tile should go and moves it- Parameters:
tile
- The tile to move- Returns:
- true if move was successful, false otherwise
-
getCurrentWord
Gets the current word formed by tiles in the word area- Returns:
- returns current word string.
-
isWordValid
public boolean isWordValid()returns true if word is in dictionary.- Returns:
- value indicating if word is valid.
-
redrawTiles
public void redrawTiles()redraws tiles into the tile rack and removes from redraw window. -
addToCombo
add combo sum and multiCombo TODO: this will changed when implementing modifiers- Parameters:
tile
- tile.
-
calcTotalScore
public int calcTotalScore()TODO: adding modifiers- Returns:
- total score int
-
setTotalScore
public void setTotalScore(int totalScore) - Parameters:
totalScore
- from calcTotalScore sets Total Score
-
playTiles
public void playTiles()clears the word row tiles. and refills the tile rack. and decreases the plays left. -
returnRedrawTilesToTheRack
public void returnRedrawTilesToTheRack()sends the selected redraw tiles back to the rack -
toggleRedrawState
public void toggleRedrawState()changes active redraw status -
setupNewLevel
public void setupNewLevel()Initialise new level. Clears word row, redraw rack. draws new tiles for the player's tile rack. -
resetCombo
public void resetCombo()resets counts for sum and multi in combo
-