Skip to content

fluescher/jass-challenge-client-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jass-challenge-client-java Build Status

This is a Java client for the Jass challenge server. This client allows you to easily develop a bot for the Jass challenge.

Getting started

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();
    }
}

Implement your own bot

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() {}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages