public class GameRunner
extends java.lang.Object
Constructor and Description |
---|
GameRunner()
Create a new GameRunner with no referee input.
|
GameRunner(java.util.Properties properties)
Create a new GameRunner with no referee input.
|
Modifier and Type | Method and Description |
---|---|
void |
addAgent(java.lang.Class<?> playerClass)
Deprecated.
Adds an AI to the next game to run.
|
void |
addAgent(java.lang.Class<?> playerClass,
java.lang.String nickname,
java.lang.String avatarUrl)
Deprecated.
Adds an AI to the next game to run.
|
void |
addAgent(java.lang.String commandLine)
Adds an AI to the next game to run.
|
void |
addAgent(java.lang.String commandLine,
java.lang.String nickname,
java.lang.String avatarUrl)
Adds an AI to the next game to run.
|
void |
start()
Runs the game and attempts to start a server on the port 8888.
|
void |
start(int port)
Runs the game and attempts to start a server on the given port.
|
public GameRunner()
public GameRunner(java.util.Properties properties)
properties
- the values given to the game's referee on init.public void addAgent(java.lang.Class<?> playerClass)
playerClass
- the Java class of an AI for your game.public void addAgent(java.lang.String commandLine)
The given command will be executed with Runtime.getRuntime().exec()
.
commandLine
- the system command line to run the AI.public void addAgent(java.lang.Class<?> playerClass, java.lang.String nickname, java.lang.String avatarUrl)
playerClass
- the Java class of an AI for your game.nickname
- the player's nicknameavatarUrl
- the url of the player's avatarpublic void addAgent(java.lang.String commandLine, java.lang.String nickname, java.lang.String avatarUrl)
The given command will be executed with Runtime.getRuntime().exec()
.
commandLine
- the system command line to run the AI.nickname
- the player's nicknameavatarUrl
- the url of the player's avatarpublic void start()
Open a webpage to the server to watch the game's replay.
public void start(int port)
Open a webpage to the server to watch the game's replay.
port
- the port on which to attempt to start the a server for the game's replay.