scrabble
Class GameState
java.lang.Object
scrabble.GameState
public class GameState
- extends java.lang.Object
Contains the results of the last play (board, hand, tile bag, score info).
You may add fields (and corresponding parameters to the constructor) and add
new methods. You should not remove any fields or modify the existing public methods.
- Author:
- stephaap, modified by CWA
Constructor Summary |
GameState(java.util.ArrayList<java.lang.Character> tilesInHand,
int totalScore,
int scoreThisPlay,
char[][] boardChars,
java.util.ArrayList<java.lang.Character> tileBag,
java.lang.String lastWordPlayed)
Constructor. |
GameState(GameState gs)
You may (or may not) find it useful to be able to clone a GameState. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GameState
public GameState(java.util.ArrayList<java.lang.Character> tilesInHand,
int totalScore,
int scoreThisPlay,
char[][] boardChars,
java.util.ArrayList<java.lang.Character> tileBag,
java.lang.String lastWordPlayed)
- Constructor.
- Parameters:
tilesInHand
- - the current tiles in the player's hadscoreThisPlay
- - the score earned on the this movetotalScore
- - the score earned overallboardChars
- - current tiles on the boardtileBag
- - tiles to be drawn fromlastWordPlayed
- contains entire word, which may be a "superstring"
of the the characters actually played on this Turn.
If one of the characters in the word is played by a blank,
it should be in lowercase. e.g. If character 2
in XENIA is a blank that represents N, the value of this
parameter should be XEnIA
GameState
public GameState(GameState gs)
- You may (or may not) find it useful to be able to clone a GameState.
- Parameters:
gs
-
getBoardChars
public char[][] getBoardChars()
- Returns:
- current tiles on the board
getScoreThisPlay
public int getScoreThisPlay()
- Returns:
- the score earned on the this move
getTilesInHand
public java.util.ArrayList<java.lang.Character> getTilesInHand()
- Returns:
- the current tiles in hand
getTotalScore
public int getTotalScore()
- Returns:
- the score earned overall
getTileBag
public java.util.ArrayList<java.lang.Character> getTileBag()
- Returns:
- tiles to be drawn from
getLastWordPlayed
public java.lang.String getLastWordPlayed()
- Returns:
- the lastWordPlayed