public class S2Coordinator
extends java.lang.Object
Modifier and Type | Method | Description |
---|---|---|
boolean |
allGamesEnded() |
Returns true if all running games have ended.
|
static PlayerSettings |
createComputer(Race race,
Difficulty difficulty) |
|
S2Coordinator |
createGame() |
Creates a game but does not join the bots to the game
|
S2Coordinator |
createGame(BattlenetMap battlenetMap) |
Creates a game but does not join the bots to the game
|
S2Coordinator |
createGame(LocalMap localMap) |
Creates a game but does not join the bots to the game
|
static PlayerSettings |
createParticipant(Race race,
S2Agent bot) |
|
boolean |
equals(java.lang.Object o) |
|
java.nio.file.Path |
getExePath() |
Gets the game executable path.
|
int |
hashCode() |
|
boolean |
hasReplays() |
Determines if there are unprocessed replays.
|
S2Coordinator |
joinGame() |
Joins agents to the game
|
void |
leaveGame() |
Requests for the currently running game to end.
|
void |
quit() |
|
boolean |
remoteSaveMap(byte[] data,
java.nio.file.Path path) |
Saves a binary blob as a map to a remote location.
|
S2Coordinator |
saveReplayList(java.nio.file.Path path) |
Saves replays to a file.
|
static SettingsSyntax |
setup() |
|
void |
setupPorts(int numberOfAgents,
java.util.function.Supplier<java.lang.Integer> portStart,
boolean checkSingle) |
Sets up the sc2 game ports to use
|
S2Coordinator |
startGame() |
Starts a game on a certain map.
|
S2Coordinator |
startGame(BattlenetMap battlenetMap) |
Starts a game on a certain map.
|
S2Coordinator |
startGame(LocalMap localMap) |
Starts a game on a certain map.
|
java.lang.String |
toString() |
|
boolean |
update() |
Helper function used to actually run a bot.
|
public void setupPorts(int numberOfAgents, java.util.function.Supplier<java.lang.Integer> portStart, boolean checkSingle)
numberOfAgents
- Number of agents in the gameportStart
- Starting port numbercheckSingle
- Checks if the game is a single player or multiplayer gamepublic static SettingsSyntax setup()
public S2Coordinator startGame()
startGame(BattlenetMap)
,
startGame(LocalMap)
public S2Coordinator startGame(LocalMap localMap)
localMap
- Path to the map to run.startGame(BattlenetMap)
,
startGame()
public S2Coordinator startGame(BattlenetMap battlenetMap)
battlenetMap
- Name of the battlenet map to run.startGame(LocalMap)
,
startGame()
public S2Coordinator createGame()
createGame(BattlenetMap)
,
createGame(LocalMap)
public S2Coordinator createGame(LocalMap localMap)
localMap
- Path to the map to run.createGame(BattlenetMap)
,
createGame()
public S2Coordinator createGame(BattlenetMap battlenetMap)
battlenetMap
- Name of the battlenet map to run.createGame(LocalMap)
,
createGame()
public S2Coordinator joinGame()
public boolean update()
For non-real time Update will perform the following:
Real time applications will perform the following:
public void leaveGame()
public boolean allGamesEnded()
public S2Coordinator saveReplayList(java.nio.file.Path path) throws java.io.IOException
path
- The file path.java.io.IOException
public boolean hasReplays()
public boolean remoteSaveMap(byte[] data, java.nio.file.Path path)
data
- The map data.path
- The file path to save the data to.public java.nio.file.Path getExePath()
public void quit()
public static PlayerSettings createParticipant(Race race, S2Agent bot)
public static PlayerSettings createComputer(Race race, Difficulty difficulty)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2017–2018 Ocraft Project. All rights reserved.