|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectGameInfo
Class GameInfo contains basic information about a race.
GameInfo is used when the necessary information about the race
is sent to the client programs. Based on this information, the client program
shows a list of races available.
All attributes are public, since this is basically a collection
of temporary information attributes.
Game,
Tracksail| Field Summary | |
int |
id
unique id of this race |
boolean |
is_racing
is the race currently in racing state |
int |
master_id
id of the player who owns this race |
java.lang.String |
name
name of this race |
int |
num_players
number of players in this race |
| Constructor Summary | |
GameInfo(int id,
java.lang.String name,
int master_id,
int num_players,
boolean is_racing)
Constructor. |
|
| Method Summary | |
private void |
readObject(java.io.ObjectInputStream in)
Reads an Object from a stream. |
java.lang.String |
toString()
Returns an image of this race. |
private void |
writeObject(java.io.ObjectOutputStream out)
Writes the game information to an Object stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public int id
public java.lang.String name
public int master_id
public int num_players
public boolean is_racing
| Constructor Detail |
public GameInfo(int id,
java.lang.String name,
int master_id,
int num_players,
boolean is_racing)
id - the unique id of this racename - the name of this racemaster_id - the id of the player who owns this racenum_players - the number of players in this raceis_racing - true if the race is currently in racing state,
false otherwise| Method Detail |
private void writeObject(java.io.ObjectOutputStream out)
throws java.io.IOException
Object stream.
out - ObjectOutputStream to write to
java.io.IOException
private void readObject(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
Object from a stream.
in - ObjectInputStream to read from
java.io.IOException
java.lang.ClassNotFoundExceptionpublic java.lang.String toString()
The image contains the name, number of players and state of the race.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||