View Javadoc

1   package cz.cuni.amis.pogamut.ut2004.tournament.match;
2   
3   import java.io.File;
4   
5   import cz.cuni.amis.pogamut.ut2004.tournament.botexecution.UT2004BotExecutionConfig;
6   import cz.cuni.amis.utils.NullCheck;
7   import cz.cuni.amis.utils.token.IToken;
8   import cz.cuni.amis.utils.token.Tokens;
9   
10  /**
11   * Describes configuration of the custom-bot created using Pogamut platform.
12   * @author Jimmy
13   */
14  public class UT2004BotConfig extends UT2004BotExecutionConfig implements IUT2004BotConfig {
15  
16  	/**
17  	 * Number of the team the bot should be in.
18  	 */
19  	private int teamNumber = 255;
20  
21  	public UT2004BotConfig() {
22  	}
23  	
24  	/**
25  	 * Copy-constructor.
26  	 * @param value
27  	 */
28  	public UT2004BotConfig(UT2004BotConfig value) {
29  		super(value);
30  		this.teamNumber = value.teamNumber;
31  	}
32  
33  	@Override
34  	public int getTeamNumber() {
35  		return teamNumber;
36  	}
37  
38  	/**
39  	 * Sets team number the bot should play for.
40  	 * @param teamNumber
41  	 */
42  	public UT2004BotConfig setTeamNumber(int teamNumber) {
43  		this.teamNumber = teamNumber;
44  		return this;
45  	}
46  	
47  	@Override
48  	public UT2004BotConfig setBotId(String botId) {
49  		super.setBotId(botId);
50  		return this;
51  	}
52  	
53  	@Override
54  	public UT2004BotConfig setBotId(IToken botId) {
55  		super.setBotId(botId);
56  		return this;
57  	}
58  	
59  	@Override
60  	public UT2004BotConfig setPathToBotJar(String pathToBotJar) {
61  		super.setPathToBotJar(pathToBotJar);
62  		return this;
63  	}
64  	
65  	@Override
66  	public UT2004BotConfig setRedirectStdErr(boolean redirectStdErr) {
67  		super.setRedirectStdErr(redirectStdErr);
68  		return this;
69  	}
70  	
71  	@Override
72  	public UT2004BotConfig setRedirectStdOut(boolean redirectStdOut) {
73  		super.setRedirectStdOut(redirectStdOut);
74  		return this;
75  	}
76  	
77  	@Override
78  	public String toString() {
79  		return "UT2004BotConfig[botId=" + getBotId().getToken() + ", team=" + teamNumber + ", jar=" + getPathToBotJar() + "]";
80  	}
81  }