Class ChallengeBot
- java.lang.Object
-
- page.codeberg.terratactician_expandoria.bots.Bot
-
- page.codeberg.terratactician_expandoria.bots.ChallengeBot
-
public abstract class ChallengeBot extends Bot
A ChallengeBot is the scaffolding for Bot playing the game in challenge mode. This class will abstract the ConnectionHandler for easy usage in challenge mode. The Bot gets the opportunity once every second to play a move or decline to play one. This class limits the execution time of the bot, too.
-
-
Field Summary
Fields Modifier and Type Field Description static int
BOT_TIMEOUT_MS
time limit for computing one move
-
Constructor Summary
Constructors Constructor Description ChallengeBot()
Empty default constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
executeTurn(World world, Controller controller)
This method be called every game resource tick.abstract int
getMatrikel()
Please return your „Matrikelnummer“ als int.java.lang.String
getModeName()
API name of the modeabstract java.lang.String
getName()
Here you can become creative.abstract java.lang.String
getStudentName()
Please return your name in a string.void
startGame(ConnectionHandler conn)
Gets called on game start.
-
-
-
Field Detail
-
BOT_TIMEOUT_MS
public static final int BOT_TIMEOUT_MS
time limit for computing one move- See Also:
- Constant Field Values
-
-
Method Detail
-
getStudentName
public abstract java.lang.String getStudentName()
Please return your name in a string.- Returns:
- name of the student
-
getMatrikel
public abstract int getMatrikel()
Please return your „Matrikelnummer“ als int.- Returns:
- matrikel number
-
getName
public abstract java.lang.String getName()
Here you can become creative. Please return the name of your Bot.- Returns:
- bot name
-
executeTurn
public abstract void executeTurn(World world, Controller controller)
This method be called every game resource tick. In real time this is every second. Then you are able to schedule a limited amount of actions with theController
. The limit is for the main competition 1.- Parameters:
world
- world object - describes the current world, with all data relevant to make a move.controller
- game controller - use this communication abstraction to send game moves to the game.
-
startGame
public final void startGame(ConnectionHandler conn)
Description copied from class:Bot
Gets called on game start. A ConnectionHandler is given for sending and receiving messages from/to the game.
-
getModeName
public final java.lang.String getModeName()
Description copied from class:Bot
API name of the mode- Specified by:
getModeName
in classBot
- Returns:
- mode string
-
-