From 552fa28b392c12c2e729b2161724fec169b8b5f6 Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 30 Sep 2013 21:59:12 -0700 Subject: [PATCH] export model_getNumTilesInTray() via jni --- xwords4/android/XWords4/jni/xwjni.c | 13 +++++++++++++ .../src/org/eehouse/android/xw4/jni/XwJNI.java | 1 + 2 files changed, 14 insertions(+) diff --git a/xwords4/android/XWords4/jni/xwjni.c b/xwords4/android/XWords4/jni/xwjni.c index 164125d0a..7735b8c0a 100644 --- a/xwords4/android/XWords4/jni/xwjni.c +++ b/xwords4/android/XWords4/jni/xwjni.c @@ -935,6 +935,19 @@ Java_org_eehouse_android_xw4_jni_XwJNI_model_1getNMoves return result; } + +JNIEXPORT jint JNICALL +Java_org_eehouse_android_xw4_jni_XwJNI_model_1getNumTilesInTray +( JNIEnv* env, jclass C, jint gamePtr, jint player ) +{ + jint result; + XWJNI_START(); + XP_ASSERT( !!state->game.model ); + result = model_getNumTilesInTray( state->game.model, player ); + XWJNI_END(); + return result; +} + JNIEXPORT jstring JNICALL Java_org_eehouse_android_xw4_jni_XwJNI_model_1getPlayersLastScore (JNIEnv* env, jclass C, jint gamePtr, jint player ) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/XwJNI.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/XwJNI.java index e25e1ad35..32ab6d68d 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/XwJNI.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/XwJNI.java @@ -215,6 +215,7 @@ public class XwJNI { public static native String model_writeGameHistory( int gamePtr, boolean gameOver ); public static native int model_getNMoves( int gamePtr ); + public static native int model_getNumTilesInTray( int gamePtr, int player ); public static native String model_getPlayersLastScore( int gamePtr, int player ); // Server