Class MenuHandler

java.lang.Object
  extended by MenuHandler

public class MenuHandler
extends java.lang.Object

This class handles the I/O and the rendering of the menu


Constructor Summary
MenuHandler()
           
 
Method Summary
 void beginGame()
          This Method calls the method of the same name in the StrategoGame class
 void createAccount()
          This Method prompts the user for an account name and attempts to insert it into the account log file, if it doesn't already exist.
 void exit()
          This Method prompts the user asking if they want to end the game and if so it calls the method of the same name in the StrategoGame class
 void layoutMenu()
          This Method lays out the menu graphically
 void logIn()
          This Method prompts the user for an account name, then searches the account log file for the account, setting it as the active account if it is found returning a IOException if it is not found.
 void logOut()
          This Method sets the active account to null
 void newGame()
          This Method calls the method of the same name in the StrategoGame class
 void player1Win()
          This Method increments player 1's wins, and player 2's losses
 void player2Win()
          This Method increments player 2's wins, and player 1's losses
 void tie()
          This Method increments both player's ties.
 void watchReplay()
          This Method prompts the user for a replay file name,and calls the StrategoGame classes show replay file with that as an argument if it is found else, returning a FileNotFoundException if it is not found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuHandler

public MenuHandler()
Method Detail

layoutMenu

public void layoutMenu()
This Method lays out the menu graphically


createAccount

public void createAccount()
This Method prompts the user for an account name and attempts to insert it into the account log file, if it doesn't already exist. It returns an IOException if an account with that name already exists. If the account log file could not be found, it creates a new one


logIn

public void logIn()
This Method prompts the user for an account name, then searches the account log file for the account, setting it as the active account if it is found returning a IOException if it is not found. If the log file is not found it returns a FileNotFoundException


logOut

public void logOut()
This Method sets the active account to null


newGame

public void newGame()
This Method calls the method of the same name in the StrategoGame class


beginGame

public void beginGame()
This Method calls the method of the same name in the StrategoGame class


watchReplay

public void watchReplay()
This Method prompts the user for a replay file name,and calls the StrategoGame classes show replay file with that as an argument if it is found else, returning a FileNotFoundException if it is not found.


exit

public void exit()
This Method prompts the user asking if they want to end the game and if so it calls the method of the same name in the StrategoGame class


player1Win

public void player1Win()
This Method increments player 1's wins, and player 2's losses


player2Win

public void player2Win()
This Method increments player 2's wins, and player 1's losses


tie

public void tie()
This Method increments both player's ties.