public class UT2004MatchConfig extends Object
GameBots2004IniUCCWrapperConfUT2004BotConfig| Modifier and Type | Class and Description |
|---|---|
static class |
UT2004MatchConfig.BotType |
| Modifier and Type | Field and Description |
|---|---|
protected Map<cz.cuni.amis.utils.token.IToken,UT2004BotConfig> |
bots |
protected GameBots2004Ini |
gb2004Ini |
protected Map<cz.cuni.amis.utils.token.IToken,UT2004HumanConfig> |
humans |
protected cz.cuni.amis.utils.token.IToken |
matchId |
protected Map<cz.cuni.amis.utils.token.IToken,UT2004NativeBotConfig> |
nativeBots |
protected File |
outputDirectory |
protected cz.cuni.amis.pogamut.ut2004.utils.UCCWrapperConf |
uccConf |
protected UT2004Ini |
ut2004Ini |
protected StringBuffer |
validationBuffer |
protected boolean |
validationError |
| Constructor and Description |
|---|
UT2004MatchConfig() |
UT2004MatchConfig(UT2004MatchConfig orig)
Copy-constructor.
|
| Modifier and Type | Method and Description |
|---|---|
UT2004MatchConfig |
addBot(UT2004BotConfig... bots)
Adds NEW bot configuration into the object, checks whether there is no BotId clash (if so, throws an exception).
|
UT2004MatchConfig |
addHuman(UT2004HumanConfig... humans)
Adds NEW bot configuration into the object, checks whether there is no BotId clash (if so, throws an exception).
|
UT2004MatchConfig |
addNativeBot(UT2004NativeBotConfig... bots)
Adds NEW native bot configuration into the object, checks whether there is no BotId clash (if so, throws an exception).
|
UT2004MatchConfig |
clearBots() |
UT2004MatchConfig |
clearHumans() |
UT2004MatchConfig |
clearNativeBots() |
boolean |
equals(Object obj) |
List<cz.cuni.amis.utils.token.IToken> |
getAllBotIds()
Ids are sorted: 1) custom bots, 2) native bots.
|
Map<cz.cuni.amis.utils.token.IToken,UT2004BotConfig> |
getBots() |
UT2004MatchConfig.BotType |
getBotType(cz.cuni.amis.utils.token.IToken botId) |
GameBots2004Ini |
getGb2004Ini()
Preinitialized automatically.
|
Map<cz.cuni.amis.utils.token.IToken,UT2004HumanConfig> |
getHumans() |
cz.cuni.amis.utils.token.IToken |
getMatchId() |
Map<cz.cuni.amis.utils.token.IToken,UT2004NativeBotConfig> |
getNativeBots() |
File |
getOutputDirectory() |
cz.cuni.amis.pogamut.ut2004.utils.UCCWrapperConf |
getUccConf() |
UT2004Ini |
getUT2004Ini()
Preinitialized automatically.
|
int |
hashCode() |
boolean |
isBot(cz.cuni.amis.utils.token.IToken botId) |
boolean |
isHuman(cz.cuni.amis.utils.token.IToken botId) |
boolean |
isHumanLikeLogEnabled() |
boolean |
isNativeBot(cz.cuni.amis.utils.token.IToken botId) |
boolean |
isStartTCServer() |
UT2004MatchConfig |
setBot(UT2004BotConfig... bots)
Sets bot configuration into the object, does not checks whether there is BotId clash.
|
UT2004MatchConfig |
setBots(Map<cz.cuni.amis.utils.token.IToken,UT2004BotConfig> bots) |
UT2004MatchConfig |
setGb2004Ini(GameBots2004Ini gb2004Ini)
No need to call, preinitialized automatically.
|
UT2004MatchConfig |
setHuman(UT2004HumanConfig... humans)
Sets human configuration into the object, does not checks whether there is BotId clash.
|
UT2004MatchConfig |
setHumanLikeLogEnabled(boolean humanLikeLog) |
void |
setMatchId(cz.cuni.amis.utils.token.IToken matchId) |
void |
setMatchId(String matchId) |
UT2004MatchConfig |
setNativeBot(UT2004NativeBotConfig... bots)
Sets native bot configuration into the object, does not checks whether there is BotId clash.
|
UT2004MatchConfig |
setNativeBots(Map<cz.cuni.amis.utils.token.IToken,UT2004NativeBotConfig> nativeBots) |
UT2004MatchConfig |
setOutputDirectory(File outputDirectory) |
void |
setStartTCServer(boolean startTCServer) |
UT2004MatchConfig |
setUccConf(cz.cuni.amis.pogamut.ut2004.utils.UCCWrapperConf uccConf) |
void |
validate()
Checks the contents, whether everything is set-up correctly, if not, raises an exception with explanation.
|
protected void |
validateInner()
Performs validation of the match configuration:
Checks whether the match id is non-null.
|
protected File outputDirectory
protected cz.cuni.amis.utils.token.IToken matchId
protected cz.cuni.amis.pogamut.ut2004.utils.UCCWrapperConf uccConf
protected UT2004Ini ut2004Ini
protected GameBots2004Ini gb2004Ini
protected Map<cz.cuni.amis.utils.token.IToken,UT2004BotConfig> bots
protected Map<cz.cuni.amis.utils.token.IToken,UT2004NativeBotConfig> nativeBots
protected Map<cz.cuni.amis.utils.token.IToken,UT2004HumanConfig> humans
protected final StringBuffer validationBuffer
protected boolean validationError
public UT2004MatchConfig()
public UT2004MatchConfig(UT2004MatchConfig orig)
orig - public File getOutputDirectory()
public cz.cuni.amis.utils.token.IToken getMatchId()
public void setMatchId(cz.cuni.amis.utils.token.IToken matchId)
public void setMatchId(String matchId)
public cz.cuni.amis.pogamut.ut2004.utils.UCCWrapperConf getUccConf()
public GameBots2004Ini getGb2004Ini()
public UT2004Ini getUT2004Ini()
public Map<cz.cuni.amis.utils.token.IToken,UT2004BotConfig> getBots()
public Map<cz.cuni.amis.utils.token.IToken,UT2004NativeBotConfig> getNativeBots()
public Map<cz.cuni.amis.utils.token.IToken,UT2004HumanConfig> getHumans()
public List<cz.cuni.amis.utils.token.IToken> getAllBotIds()
WARNING: O(n*log(n)) complexity!
public UT2004MatchConfig setOutputDirectory(File outputDirectory)
public UT2004MatchConfig setUccConf(cz.cuni.amis.pogamut.ut2004.utils.UCCWrapperConf uccConf)
public UT2004MatchConfig setGb2004Ini(GameBots2004Ini gb2004Ini)
public UT2004MatchConfig setBots(Map<cz.cuni.amis.utils.token.IToken,UT2004BotConfig> bots)
public UT2004MatchConfig setNativeBots(Map<cz.cuni.amis.utils.token.IToken,UT2004NativeBotConfig> nativeBots)
public UT2004MatchConfig clearBots()
public UT2004MatchConfig clearNativeBots()
public UT2004MatchConfig clearHumans()
public UT2004MatchConfig addBot(UT2004BotConfig... bots)
bots - public UT2004MatchConfig setBot(UT2004BotConfig... bots)
bots - public UT2004MatchConfig addNativeBot(UT2004NativeBotConfig... bots)
bots - public UT2004MatchConfig setNativeBot(UT2004NativeBotConfig... bots)
bots - public UT2004MatchConfig addHuman(UT2004HumanConfig... humans)
bots - public UT2004MatchConfig setHuman(UT2004HumanConfig... humans)
humans - public boolean isBot(cz.cuni.amis.utils.token.IToken botId)
public boolean isNativeBot(cz.cuni.amis.utils.token.IToken botId)
public boolean isHuman(cz.cuni.amis.utils.token.IToken botId)
public UT2004MatchConfig.BotType getBotType(cz.cuni.amis.utils.token.IToken botId)
public boolean isHumanLikeLogEnabled()
public UT2004MatchConfig setHumanLikeLogEnabled(boolean humanLikeLog)
public boolean isStartTCServer()
public void setStartTCServer(boolean startTCServer)
protected void validateInner()
UccWrapper is not null and its directory exists.GameBots2004Ini is not null.Override to provide/add custom validation (might require copy-paste of the code from this method).
public final void validate()
Recalls validateInner() that should fill validationBuffer with
messages and if there is a fatal error in the configuration, it should set true to validationError.
Copyright © 2019 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All rights reserved.