This commit is contained in:
nora 2023-01-09 11:01:06 +01:00
parent 59a7ad0af9
commit b083ef958d
4 changed files with 39 additions and 2 deletions

View file

@ -11,6 +11,12 @@ java {
}
}
jar {
manifest {
attributes 'Main-Class': 'ch.bbw.m411.connect4.Connect4ArenaMain'
}
}
repositories {
mavenCentral()
}
@ -23,4 +29,4 @@ dependencies {
tasks.named('test') {
useJUnitPlatform()
}
}

View file

@ -3,6 +3,13 @@ package ch.bbw.m411.connect4;
public class RustPlayer extends Connect4ArenaMain.DefaultPlayer {
private static native int rustPlay(byte player, byte[] board);
static {
// This actually loads the shared object that we'll be creating.
// The actual location of the .so or .dll may differ based on your
// platform.
System.loadLibrary("rs_wrapper");
}
@Override
protected int play() {
byte player = switch (this.myColor) {