netGameManager
Class GameClient
java.lang.Object
netGameManager.GameClient
public class GameClient
- extends java.lang.Object
This class is responsible for all comunication with GameServer
.
GameServer manages instances of Game
games.
This class has two main functionality:
1. create a new game in the server [using the parameters: type (String), name (String), Player (List of String)];
2. join an an game in the server [using only the game_id (int)];
- Version:
- 0.5 beta - 03/15/2006
- Author:
- Luciano Antonio Digiampietri
- See Also:
GameServer
,
Game
Constructor Summary |
GameClient(int game_id)
|
GameClient(java.lang.String name)
|
GameClient(java.lang.String game_type,
java.lang.String name,
java.util.List Players)
Solicites the creation of a new game in a GameServer . |
Method Summary |
boolean |
add(int x,
int y)
|
boolean |
can_add(int x,
int y,
java.lang.String Player)
|
boolean |
can_move(int x1,
int y1,
int x2,
int y2,
java.lang.String Player)
|
java.lang.String |
current_board()
|
boolean |
end_game()
|
boolean |
end_turn(java.lang.String Player)
|
int |
get_columns()
|
int |
get_lines()
|
java.lang.String |
get_name()
|
void |
initialize_board()
|
boolean |
move(int x1,
int y1,
int x2,
int y2,
java.lang.String Player)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GAME_TYPE
public java.lang.String GAME_TYPE
lines
public int lines
columns
public int columns
Winner
public java.lang.String Winner
GAME_ENDED
public boolean GAME_ENDED
PLAYERS
public java.util.List PLAYERS
GamePlayer
public java.lang.String GamePlayer
GameClient
public GameClient(java.lang.String name)
GameClient
public GameClient(java.lang.String game_type,
java.lang.String name,
java.util.List Players)
- Solicites the creation of a new game in a
GameServer
.
- Parameters:
game_type
- (String) - type of game to created (example: checkers, tic tac toe, deflexion);name
- (String) - label of the game (example: checker123);Players
- (List of String) - a list with the Players ID;- See Also:
GameServer
GameClient
public GameClient(int game_id)
- Parameters:
game_id
- (int) - a ID of a game in the server, used to join a game;
initialize_board
public void initialize_board()
current_board
public java.lang.String current_board()
can_add
public boolean can_add(int x,
int y,
java.lang.String Player)
move
public boolean move(int x1,
int y1,
int x2,
int y2,
java.lang.String Player)
end_turn
public boolean end_turn(java.lang.String Player)
can_move
public boolean can_move(int x1,
int y1,
int x2,
int y2,
java.lang.String Player)
add
public boolean add(int x,
int y)
get_name
public java.lang.String get_name()
get_lines
public int get_lines()
get_columns
public int get_columns()
end_game
public boolean end_game()