com.asdf.server
Class GameFactory

java.lang.Object
  extended by com.asdf.server.GameFactory

public class GameFactory
extends java.lang.Object

Handles dynamic loading and initializing of new games.


Constructor Summary
GameFactory()
           
 
Method Summary
static Game createGame(java.lang.String[] classDirs, java.lang.String className, Server server, long gameID, java.lang.String name)
          Tries to load and initialize a class found in classDir in package className.
static Game createGame(java.lang.String className, Server server, long gameID, java.lang.String name)
          Tries to load and initialize a class found in classDir in package className.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GameFactory

public GameFactory()
Method Detail

createGame

public static Game createGame(java.lang.String[] classDirs,
                              java.lang.String className,
                              Server server,
                              long gameID,
                              java.lang.String name)
                       throws PluginLoadException
Tries to load and initialize a class found in classDir in package className. Class is casted to Game before returning.

Parameters:
classDirs - Directory from where the class is loaded from.
className - Fully qualified name of the class
server - Server instance
gameID - ID of the new game
name - Name of the game
Returns:
Instance of requested Game
Throws:
PluginLoadException

createGame

public static Game createGame(java.lang.String className,
                              Server server,
                              long gameID,
                              java.lang.String name)
                       throws PluginLoadException
Tries to load and initialize a class found in classDir in package className. Class is casted to Game before returning.

Parameters:
className - Fully qualified name of the class
server - Server instance
gameID - ID of the new game
name - Name of the game
Returns:
Instance of requested Game
Throws:
PluginLoadException