View Javadoc

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