View Javadoc

1   package cz.cuni.amis.pogamut.ut2004.tournament.match;
2   
3   import cz.cuni.amis.utils.token.IToken;
4   import cz.cuni.amis.utils.token.Tokens;
5   
6   /**
7    * Describes configuratioin of UT2004 native bot.
8    * 
9    * @author Jimmy
10   */
11  public class UT2004NativeBotConfig implements IUT2004BotConfig {
12  
13  	/**
14  	 * Unique id of this bot, used for reference inside tournament results.
15  	 * <p><p>
16  	 * DOES NOT MEAN THAT THE EXECUTED BOT WILL HAVE THIS ID IN UT2004!
17  	 */
18  	private IToken botId;
19  	
20  	/**
21  	 * Number of the team the bot should be in. 
22  	 */
23  	private int teamNumber = 255;
24  	
25  	/**
26  	 * Skill level of the native bot. From 1 to 7 (best). Default: 4.
27  	 */
28  	private int skillLevel = 4;
29  
30  	public UT2004NativeBotConfig() {
31  	}
32  
33  	/**
34  	 * Copy-constructor.
35  	 * @param value
36  	 */
37  	public UT2004NativeBotConfig(UT2004NativeBotConfig value) {
38  		this.botId = value.getBotId();
39  		this.teamNumber = value.getTeamNumber();
40  		this.skillLevel = value.getSkillLevel();
41  	}
42  
43  	@Override
44  	public IToken getBotId() {
45  		return botId;
46  	}
47  
48  	/**
49  	 * Sets ID of this bot configuration. This ID will be used for storing result of the tournament for this bot.
50  	 * <p><p>
51  	 * DOES NOT MEAN THAT THE EXECUTED BOT WILL HAVE THIS ID IN UT2004!
52  	 * 
53  	 * @param botId
54  	 */
55  	public UT2004NativeBotConfig setBotId(IToken botId) {
56  		this.botId = botId;
57  		return this;
58  	}
59  	
60  	/**
61  	 * Sets ID of this bot configuration. This ID will be used for storing result of the tournament for this bot.
62  	 * <p><p>
63  	 * DOES NOT MEAN THAT THE EXECUTED BOT WILL HAVE THIS ID IN UT2004!
64  	 * 
65  	 * @param botId
66  	 */
67  	public UT2004NativeBotConfig setBotId(String botId) {
68  		this.botId = Tokens.get(botId);
69  		return this;
70  	}
71  
72  	@Override
73  	public int getTeamNumber() {
74  		return teamNumber;
75  	}
76  
77  	/**
78  	 * Sets team number of the team the bot should join.
79  	 * @param teamNumber
80  	 * @return
81  	 */
82  	public UT2004NativeBotConfig setTeamNumber(int teamNumber) {
83  		this.teamNumber = teamNumber;
84  		return this;
85  	}
86  
87  	/**
88  	 * Skill level of the native bot.
89  	 * @return
90  	 */
91  	public int getSkillLevel() {
92  		return skillLevel;
93  	}
94  
95  	/**
96  	 * Sets desired skill level that the bot should have. From 1 to 7 (best). Default: 4.
97  	 * @param skillLevel
98  	 * @return
99  	 */
100 	public UT2004NativeBotConfig setSkillLevel(int skillLevel) {
101 		this.skillLevel = skillLevel;
102 		return this;
103 	}
104 
105 }