scrabble
Class GameState

java.lang.Object
  extended by 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.
 
Method Summary
 char[][] getBoardChars()
           
 java.lang.String getLastWordPlayed()
           
 int getScoreThisPlay()
           
 java.util.ArrayList<java.lang.Character> getTileBag()
           
 java.util.ArrayList<java.lang.Character> getTilesInHand()
           
 int getTotalScore()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 had
scoreThisPlay - - the score earned on the this move
totalScore - - the score earned overall
boardChars - - current tiles on the board
tileBag - - tiles to be drawn from
lastWordPlayed - 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 -
Method Detail

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