Package dev.robocode.tankroyale.botapi
Interface BotInfo.IBuilder
-
Method Summary
Modifier and TypeMethodDescriptionAdds an author of the bot.addCountryCode
(String countryCode) Adds a country code for the bot.addGameType
(String gameType) Adds a game type that this bot is capable of participating in.build()
Builds and returns theBotInfo
instance based on the data set and added to this builder so far.Copies all fields from aBotInfo
instance into this builder.setAuthors
(List<String> authors) Sets the names(s) of the author(s) of the bot.setCountryCodes
(List<String> countryCodes) Sets the country codes for the bot.setDescription
(String description) Sets a short description of the bot.setGameTypes
(Set<String> gameTypes) Sets the game types that this bot is capable of participating in.setHomepage
(String homepage) Sets a link to the homepage for the bot.setInitialPosition
(InitialPosition initialPosition) Sets the initial position of this bot.Sets the bot name.setPlatform
(String platform) Sets the name of the platform that this bot is build for.setProgrammingLang
(String programmingLang) Sets the name of the programming language used for developing this bot.setVersion
(String version) Sets the bot version.
-
Method Details
-
build
-
copy
Copies all fields from aBotInfo
instance into this builder.- Parameters:
botInfo
- is theBotInfo
instance to copy.- Returns:
- this
BotInfo.IBuilder
instance provided for method chaining.
-
setName
Sets the bot name. (required)
Note that the maximum length of the name is 30 characters.
Example of a name: "Rampage"- Parameters:
name
- is the name of the bot.- Returns:
- this
BotInfo.IBuilder
instance provided for method chaining.
-
setVersion
Sets the bot version. (required)
Note that the maximum length of the version is 20 characters.
Example of a version: "1.0"- Parameters:
version
- is the version of the bot.- Returns:
- this
BotInfo.IBuilder
instance provided for method chaining.
-
setAuthors
Sets the names(s) of the author(s) of the bot. (required)
Note that the maximum length of an author name is 50 characters, and the maximum number of names is 5.
Example of the name of an author: "John Doe"- Parameters:
authors
- is a list containing the names(s) of the author(s). Anull
removes all authors.- Returns:
- this
BotInfo.IBuilder
instance provided for method chaining. - See Also:
-
addAuthor
Adds an author of the bot. (required)
SeesetAuthors(java.util.List<java.lang.String>)
for more details.- Parameters:
author
- is the name of an author to add.- Returns:
- this
BotInfo.IBuilder
instance provided for method chaining. - See Also:
-
setDescription
Sets a short description of the bot. (optional)
Note that the maximum length of the description is 250 characters. Line-breaks (line-feed / new-line character) are supported, but only expect up to 3 lines to be displayed on a UI.
Example of a description:"The rampage bot will try to ram bots that are very close.\n Sneaks around the corners and shoot at the bots that come too near."
- Parameters:
description
- is a short description of the bot.- Returns:
- this
BotInfo.IBuilder
instance provided for method chaining.
-
setHomepage
Sets a link to the homepage for the bot. (optional)
Note that the maximum length of a link is 150 characters.
Example of a link: "https://fictive-homepage.net/Rampage"- Parameters:
homepage
- is a link to a homepage for the bot.- Returns:
- this
BotInfo.IBuilder
instance provided for method chaining.
-
setCountryCodes
Sets the country codes for the bot. (optional)
Note that the maximum length of each country code is 2 (alpha-2) from the ISO 3166 international standard, and the maximum number of country codes is 5.
Example of a country code: "dk"
Note that if no country code is specified, or the none of the country codes provided is valid, then the default a list containing a single country code will automatically be used containing the current locale country code. The current local country code will be extracted usingLocale.getDefault()
.- Parameters:
countryCodes
- is a list containing the country codes. Anull
removes all country codes.- Returns:
- this
BotInfo.IBuilder
instance provided for method chaining. - See Also:
-
addCountryCode
Adds a country code for the bot. (optional)
SeesetCountryCodes(java.util.List<java.lang.String>)
for more details.- Parameters:
countryCode
- is the country code to add.- Returns:
- this
BotInfo.IBuilder
instance provided for method chaining. - See Also:
-
setGameTypes
Sets the game types that this bot is capable of participating in. (required)
The standard game types are listed here.
Note that more game types might be added in the future.
TheGameType
class contains the string for the current predefined game types, which can be used when setting the game types of this method.
Note that the maximum length of a game type is 20, and the maximum number of game types is 10.
Example of a game type: "classic"
Example of usage:BotInfo.builder() .setGameTypes(Set.of(GameType.CLASSIC, GameType.MELEE, "future-type")) ...
- Parameters:
gameTypes
- is a set of game types that the bot is capable of participating in. Anull
removes all game types.- Returns:
- this
BotInfo.IBuilder
instance provided for method chaining. - See Also:
-
addGameType
Adds a game type that this bot is capable of participating in. (required)
SeesetGameTypes(java.util.Set<java.lang.String>)
for more details.
Example of usage:BotInfo.builder() .addGameType(GameType.CLASSIC) .addGameType(GameType.MELEE) ...
- Parameters:
gameType
- is a game type that the bot is capable of participating in.- Returns:
- this
BotInfo.IBuilder
instance provided for method chaining. - See Also:
-
setPlatform
Sets the name of the platform that this bot is build for. (optional)
Note that the maximum length of the name of the platform is 30.
If the platform is set tonull
or a blank string, then this default string will be used for this API:Java Runtime Environment (JRE) [version]
- Parameters:
platform
- is the name of the platform that this bot is build for.- Returns:
- this
BotInfo.IBuilder
instance provided for method chaining.
-
setProgrammingLang
Sets the name of the programming language used for developing this bot. (optional)
Note that the maximum length of the name of the programming language is 30.- Parameters:
programmingLang
- is the name of the programming language used for developing this bot.- Returns:
- this
BotInfo.IBuilder
instance provided for method chaining.
-
setInitialPosition
Sets the initial position of this bot. (optional)
Note that initial positions must be enabled/allowed with the game (server) in order to take effect.- Parameters:
initialPosition
- is the initial position of this bot.- Returns:
- this
BotInfo.IBuilder
instance provided for method chaining.
-