remove nPlayers from game_summarize

This commit is contained in:
Andy2 2010-11-19 18:23:34 -08:00
parent 92940e6638
commit 71059e6dff
2 changed files with 7 additions and 7 deletions

View file

@ -986,13 +986,13 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1receiveMessage
JNIEXPORT void JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_game_1summarize
( JNIEnv* env, jclass C, jint gamePtr, jint nPlayers, jobject jsummary )
( JNIEnv* env, jclass C, jint gamePtr, jobject jsummary )
{
LOG_FUNC();
XWJNI_START();
XP_S16 nMoves = model_getNMoves( state->game.model );
ModelCtxt* model = state->game.model;
XP_S16 nMoves = model_getNMoves( model );
setInt( env, jsummary, "nMoves", nMoves );
setInt( env, jsummary, "nPlayers", nPlayers );
XP_Bool gameOver = server_getGameIsOver( state->game.server );
setBool( env, jsummary, "gameOver", gameOver );
@ -1017,17 +1017,18 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1summarize
}
}
XP_U16 nPlayers = model_getNPlayers( model );
jint jvals[nPlayers];
int ii;
if ( gameOver ) {
ScoresArray scores;
model_figureFinalScores( state->game.model, &scores, NULL );
model_figureFinalScores( model, &scores, NULL );
for ( ii = 0; ii < nPlayers; ++ii ) {
jvals[ii] = scores.arr[ii];
}
} else {
for ( ii = 0; ii < nPlayers; ++ii ) {
jvals[ii] = model_getPlayerScore( state->game.model, ii );
jvals[ii] = model_getPlayerScore( model, ii );
}
}
jintArray jarr = makeIntArray( env, nPlayers, jvals );

View file

@ -95,8 +95,7 @@ public class XwJNI {
public static native boolean game_receiveMessage( int gamePtr,
byte[] stream );
public static native void game_summarize( int gamePtr, int nPlayers,
GameSummary summary );
public static native void game_summarize( int gamePtr, GameSummary summary );
public static native byte[] game_saveToStream( int gamePtr,
CurGameInfo gi );
public static native boolean game_hasComms( int gamePtr );