use new field to determine if simple relay config dialog can handle

the game or if user's already changed it enough that the full-on
dialog is required.
This commit is contained in:
Andy2 2010-11-06 18:26:09 -07:00
parent f36b253ae7
commit 73d7c7a27b
2 changed files with 15 additions and 1 deletions

View file

@ -270,7 +270,16 @@ public class GamesList extends XWListActivity
GameSummary summary = DBUtils.getSummary( this, path );
if ( summary.conType == CommsAddrRec.CommsConnType.COMMS_CONN_RELAY
&& summary.roomName.length() == 0 ) {
GameUtils.doConfig( this, path, RelayGameActivity.class );
// If it's unconfigured and of the type RelayGameActivity
// can handle send it there, otherwise use the full-on
// config.
Class clazz;
if ( RelayGameActivity.isSimpleGame( summary ) ) {
clazz = RelayGameActivity.class;
} else {
clazz = GameConfig.class;
}
GameUtils.doConfig( this, path, clazz );
} else {
File file = new File( path );
Uri uri = Uri.fromFile( file );

View file

@ -107,4 +107,9 @@ public class RelayGameActivity extends XWActivity
}
}
public static boolean isSimpleGame( GameSummary summary )
{
return summary.nPlayers == 2;
}
} // class RelayGameActivity