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 longBOT_TIMEOUT_MStime limit for computing one movestatic longMAX_SURPLUSmaximum time the bot can amass in ms
-
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 voidexecuteTurn(World world, Controller controller)This method be called every game resource tick.abstract intgetMatrikel()Please return your „Matrikelnummer“ als int.java.lang.StringgetModeName()API name of the modeabstract java.lang.StringgetName()Here you can become creative.abstract java.lang.StringgetStudentName()Please return your name in a string.voidstartGame(ConnectionHandler conn)Gets called on game start.
-
-
-
Field Detail
-
BOT_TIMEOUT_MS
public static final long BOT_TIMEOUT_MS
time limit for computing one move- See Also:
- Constant Field Values
-
MAX_SURPLUS
public static final long MAX_SURPLUS
maximum time the bot can amass in ms- 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:BotGets 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:BotAPI name of the mode- Specified by:
getModeNamein classBot- Returns:
- mode string
-
-