com.asdf.server
Class GameFactory
java.lang.Object
com.asdf.server.GameFactory
public class GameFactory
- extends java.lang.Object
Handles dynamic loading and initializing of new games.
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 |
GameFactory
public GameFactory()
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 classserver
- Server instancegameID
- ID of the new gamename
- 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 classserver
- Server instancegameID
- ID of the new gamename
- Name of the game
- Returns:
- Instance of requested Game
- Throws:
PluginLoadException