|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.simplegamenet.specs.model.GameFactory
An abstract superclass which represents the game. All the game module classes originate directly or indirectly from the subclass of this game interface. The subclass of this game interface should be set as the main class of the game package for the SimpleGameNet framework to find.
GameServer
,
GamePlayerClient
,
GameSettings
Constructor Summary | |
protected |
GameFactory(String name,
Version version,
String description,
String author)
Creates a new game interface and sets required information about the game. |
Method Summary | |
int |
compareTo(Object o)
Compares two game interfaces lexicographically, primarily on name and secondarily on author. |
GameSettings |
createDefaultGameSettings()
Creates new game settings with default values. |
abstract GamePlayerClient |
createGamePlayerClient(ClientEngine clientEngine)
Creates a new game player client. |
abstract GameServer |
createGameServer(ServerEngine serverEngine)
Creates a new game server. |
boolean |
equals(Object o)
Compares this game interface to the specified object. |
String |
getAuthor()
Gets the author of the game. |
String |
getDescription()
Gets the description of the game. |
Version |
getMinimumSimpleGameNetVersion()
Returns the oldest version the SimpleGameNet framework can have to be able to run this game. |
String |
getName()
Gets the name of the game. |
Version |
getVersion()
Gets the version of the game. |
boolean |
isBotProvided()
Returns true if the game includes a bot. |
String |
toString()
Returns the name appended with the version string of the game. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected GameFactory(String name, Version version, String description, String author)
super
.
The arguments are shown in the connection wizard and the "Status" tab.
name
- The name of the game. This name can contain spaces but should resemble the
jar file and package name.version
- The version of the game, which is used to assert that a server and its
clients run the same game version.description
- the description of the gameauthor
- the name of the author or group of authors who wrote the gameMethod Detail |
public abstract GameServer createGameServer(ServerEngine serverEngine)
serverEngine
- the server engine to construct a new game server with
public abstract GamePlayerClient createGamePlayerClient(ClientEngine clientEngine)
clientEngine
- the client engine to construct a new game player client with
public GameSettings createDefaultGameSettings()
public boolean isBotProvided()
true
if the game includes a bot. Currently bots are not yet supported by
the SimpleGameNet framework. This method will be used in future versions of the SimpleGameNet
framework.
true
if the game includes a botpublic String getName()
public String toString()
public Version getVersion()
public String getDescription()
public String getAuthor()
public Version getMinimumSimpleGameNetVersion()
public boolean equals(Object o)
true
if both
game interfaces have the same name and author.
o
- the o to compare this game interface against
true
if the game interfaces have the same name and authorpublic int compareTo(Object o)
compareTo
in interface Comparable
o
- the object to compare this game interface against
0
if the argument game interfaces name with author is equal to
those of this game interface, a value less than 0
if this game
interfaces name with author is lexicographically less than those of the argument and
a value greater than 0
if this game interfaces name with author is
lexicographically greater than those of the argument.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |