diff --git a/src/native/main.cpp b/src/native/main.cpp index 8a50141..0454b66 100644 --- a/src/native/main.cpp +++ b/src/native/main.cpp @@ -173,11 +173,49 @@ JNIEXPORT jobject JNICALL Java_org_neoflock_NeoNucleus_NativeBindings_nn_1create JNIEXPORT jobject JNICALL Java_org_neoflock_NeoNucleus_NativeBindings_nn_1getComputerState (JNIEnv * env, jclass, jobject computer) { nn_Computer* nnPC = (nn_Computer*) Carbon::PointerBacked::GetPointer(env, computer); - NULLPTR_CHECK(nnPC, nn_Component); + NULLPTR_CHECK(nnPC, nn_Computer); return Carbon::Map::To_nn_ComputerState(env, nn_getComputerState(nnPC)); } JNIEXPORT jobject JNICALL Java_org_neoflock_NeoNucleus_NativeBindings_getLuaArch (JNIEnv * env, jclass) { return Carbon::Map::To_nn_Architecture(env, getLuaArch()); +} +JNIEXPORT void JNICALL Java_org_neoflock_NeoNucleus_NativeBindings_nn_1setCallBudget + (JNIEnv * env, jclass, jobject computer, jdouble budget) { + nn_Computer* nnPC = (nn_Computer*) Carbon::PointerBacked::GetPointer(env, computer); + NULLPTR_CHECKNR(nnPC, nn_Computer); + nn_setCallBudget(nnPC, budget); +} + +JNIEXPORT void JNICALL Java_org_neoflock_NeoNucleus_NativeBindings_nn_1setTotalEnergy + (JNIEnv * env, jclass, jobject computer, jdouble maxEnergy) { + nn_Computer* nnPC = (nn_Computer*) Carbon::PointerBacked::GetPointer(env, computer); + NULLPTR_CHECKNR(nnPC, nn_Computer); + nn_setTotalEnergy(nnPC, maxEnergy); +} + +JNIEXPORT void JNICALL Java_org_neoflock_NeoNucleus_NativeBindings_nn_1setArchitecture + (JNIEnv * env, jclass, jobject computer, jobject arch) { + nn_Computer* nnPC = (nn_Computer*) Carbon::PointerBacked::GetPointer(env, computer); + nn_Architecture* nnArch = (nn_Architecture*) Carbon::PointerBacked::GetPointer(env, arch); + NULLPTR_CHECKNR(nnPC, nn_Computer); + NULLPTR_CHECKNR(nnArch, nn_Architecture); + + nn_setArchitecture(nnPC, nnArch); +} + +JNIEXPORT jobject JNICALL Java_org_neoflock_NeoNucleus_NativeBindings_nn_1addSupportedArchitecture + (JNIEnv * env, jclass, jobject computer, jobject arch) { + nn_Computer* nnPC = (nn_Computer*) Carbon::PointerBacked::GetPointer(env, computer); + nn_Architecture* nnArch = (nn_Architecture*) Carbon::PointerBacked::GetPointer(env, arch); + NULLPTR_CHECKNR(nnPC, nn_Computer); + NULLPTR_CHECKNR(nnArch, nn_Architecture); + + nn_addSupportedArchitecture(nnPC, nnArch); +} + +JNIEXPORT jobject JNICALL Java_org_neoflock_NeoNucleus_NativeBindings_nn_1setTmpAddress + (JNIEnv *, jclass, jobject computer, jstring address) { + // TODO } \ No newline at end of file