Interface IView

All Known Implementing Classes:
GuiView, Printer

public interface IView


Method Summary
 void getNextMove()
          This method gets the next move from the view.
 void makeMove()
          Method called by View class.
 void printAll()
          Main print function, which outputs all the cards visible to the user, and their positions.
 void printEnd()
          Prints end of game message
 void printPlayAgainQuery()
          Asks user if he/she wants to play again
 void printTitle()
          prints the title of the game
 void setFreecell(Freecell f)
          This method associated the IView object with a freecell game f.
 void showError()
          Displays an error message informing the user they have attempted an invalid move.
 

Method Detail

setFreecell

void setFreecell(Freecell f)
This method associated the IView object with a freecell game f. It also tells each of the pile models to set its view to a new IPileView.

Parameters:
f - the freecell object to be linked to this view

printTitle

void printTitle()
prints the title of the game


printAll

void printAll()
Main print function, which outputs all the cards visible to the user, and their positions. This is not used for the GUI view because the whole screen does not need to be redrawn each time a move is made.


printEnd

void printEnd()
Prints end of game message


printPlayAgainQuery

void printPlayAgainQuery()
Asks user if he/she wants to play again


makeMove

void makeMove()
Method called by View class. In accordance with the view Gets position of card(s)to be moved, and position the user wants to move them to.

If positions are valid, calls Freecell methods to move the cards, accordingly


showError

void showError()
Displays an error message informing the user they have attempted an invalid move.


getNextMove

void getNextMove()
This method gets the next move from the view. For the GUI version this is unnecessary and thus has a blank implementation because the SolitaireListeners handle it.