lab1
Class GameFactory

java.lang.Object
  extended by lab1.GameFactory
All Implemented Interfaces:
IGameFactory

public class GameFactory
extends java.lang.Object
implements IGameFactory

Factory class for available games.


Constructor Summary
GameFactory()
           
 
Method Summary
 GameModel createGame(java.lang.String gameName)
          Returns a new model object for the game corresponding to its Name.
 java.lang.String[] getGameNames()
          Returns an array with names of games this factory can create.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GameFactory

public GameFactory()
Method Detail

getGameNames

public java.lang.String[] getGameNames()
Returns an array with names of games this factory can create. Used by GUI list availible games.

Specified by:
getGameNames in interface IGameFactory

createGame

public GameModel createGame(java.lang.String gameName)
Returns a new model object for the game corresponding to its Name.

Specified by:
createGame in interface IGameFactory
Parameters:
gameName - The name of the game as given by getGameNames()
Throws:
java.lang.IllegalArgumentException - if no such game