This is a Java client for the Jass challenge server. This client allows you to easily develop a bot for the Jass challenge.
Clone this repository and start (gradle run
) the Application class:
public class Application {
public static void main(String[] args) throws Exception {
final String name = "Your bot name here";
final Player myLocalPlayer = new Player(name, new RandomMoveJassStrategy());
final RemoteGame remoteGame = new RemoteGame("ws://jasschallenge.herokuapp.com", myLocalPlayer, SessionType.SINGLE_GAME);
remoteGame.start();
}
}
To implement your own bot you need to provide an implementation of the JassStrategy interface:
public interface JassStrategy {
Mode chooseTrumpf(Set<Card> availableCards, GameSession session);
Card chooseCard(Set<Card> availableCards, GameSession session);
default void onSessionStarted(GameSession session) {}
default void onGameStarted(GameSession session) {}
default void onMoveMade(Move move, GameSession session) {}
default void onGameFinished() {}
default void onSessionFinished() {}
}