public class UT2004MatchConfig extends Object
GameBots2004Ini
UCCWrapperConf
UT2004BotConfig
Modifier and Type | Field and Description |
---|---|
protected Map<cz.cuni.amis.utils.token.IToken,UT2004BotConfig> |
bots |
protected GameBots2004Ini |
gb2004Ini |
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 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 |
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 |
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() |
GameBots2004Ini |
getGb2004Ini()
Preinitialized automatically.
|
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() |
int |
hashCode() |
boolean |
isNativeBot(cz.cuni.amis.utils.token.IToken botId) |
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.
|
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) |
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.
Checks whether all (custom+native) bots have path-to-jar configured + the file exists.
UccWrapper is not null and its directory exists.
Presence of GameBots2004.u as a new game type inside UT2004.
GameBots2004Ini is not null.
Whether there are at least 2 bots defined for the match.
|
protected File outputDirectory
protected cz.cuni.amis.utils.token.IToken matchId
protected cz.cuni.amis.pogamut.ut2004.utils.UCCWrapperConf uccConf
protected GameBots2004Ini gb2004Ini
protected Map<cz.cuni.amis.utils.token.IToken,UT2004BotConfig> bots
protected Map<cz.cuni.amis.utils.token.IToken,UT2004NativeBotConfig> nativeBots
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 Map<cz.cuni.amis.utils.token.IToken,UT2004BotConfig> getBots()
public Map<cz.cuni.amis.utils.token.IToken,UT2004NativeBotConfig> getNativeBots()
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 addBot(UT2004BotConfig... bots)
bots
- public UT2004MatchConfig setBot(UT2004BotConfig... bots)
bots
- public UT2004MatchConfig addNativeBot(UT2004NativeBotConfig... bots)
bots
- public UT2004MatchConfig setNativeBot(UT2004NativeBotConfig... bots)
bots
- public boolean isNativeBot(cz.cuni.amis.utils.token.IToken botId)
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 © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.