Exemplo n.º 1
0
/*
 * Class:     DoomGame
 * Method:    setNextAction
 * Signature: (Ljava/util/ArrayList;)V
 */
JNIEXPORT void JNICALL Java_vizdoom_DoomGame_setAction
  (JNIEnv *env, jobject obj, jintArray ourarray){
    try {
        DoomGame* game = GetObject(env,obj);
        int NumElts = env->GetArrayLength(ourarray);
        jint *oarr = env->GetIntArrayElements(ourarray, NULL);
        std::vector<int> ourvector;
        for (int i=0;i<NumElts;i++){
            ourvector.push_back(oarr[i]);
        }
        game->setAction(ourvector);
    }
    catch(...){
        throwAsJavaException(env);
    }
}