mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-29 10:26:36 +01:00
add copy constructors; change starting game to two players, second a
robot.
This commit is contained in:
parent
71fe75049b
commit
1a4f0e04bf
2 changed files with 26 additions and 4 deletions
|
@ -26,15 +26,29 @@ public class CurGameInfo {
|
|||
public boolean confirmBTConnect; /* only used for BT */
|
||||
|
||||
public CurGameInfo() {
|
||||
nPlayers = 3;
|
||||
nPlayers = 2;
|
||||
boardSize = 15;
|
||||
players = new LocalPlayer[nPlayers];
|
||||
serverRole = DeviceRole.SERVER_STANDALONE;
|
||||
dictName = BUILTIN_DICT;
|
||||
hintsNotAllowed = false;
|
||||
players[0] = new LocalPlayer( "Eric");
|
||||
players[1] = new LocalPlayer( "Kati", true );
|
||||
players[2] = new LocalPlayer( "Brynn", true );
|
||||
players[0] = new LocalPlayer( "Player 1");
|
||||
players[1] = new LocalPlayer( "Player 2", true );
|
||||
}
|
||||
|
||||
public CurGameInfo( CurGameInfo src ) {
|
||||
nPlayers = src.nPlayers;
|
||||
boardSize = src.boardSize;
|
||||
players = new LocalPlayer[nPlayers];
|
||||
serverRole = src.serverRole;
|
||||
dictName = src.dictName;
|
||||
hintsNotAllowed = src.hintsNotAllowed;
|
||||
|
||||
int ii;
|
||||
for ( ii = 0; ii < nPlayers; ++ii ) {
|
||||
players[ii] = new LocalPlayer( src.players[ii] );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,14 @@ public class LocalPlayer {
|
|||
password = "";
|
||||
}
|
||||
|
||||
public LocalPlayer( LocalPlayer src ) {
|
||||
isLocal = src.isLocal;
|
||||
isRobot = src.isRobot;
|
||||
name = src.name;
|
||||
password = src.password;
|
||||
secondsUsed = 0;
|
||||
}
|
||||
|
||||
public LocalPlayer( String nm, boolean robot ) {
|
||||
this( nm );
|
||||
isRobot = robot;
|
||||
|
|
Loading…
Reference in a new issue