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  	/** Class representing this bot in game */
31  	private String botClass = "JakobM";
32  
33  	public UT2004NativeBotConfig() {
34  	}
35  
36  	/**
37  	 * Copy-constructor.
38  	 * @param value
39  	 */
40  	public UT2004NativeBotConfig(UT2004NativeBotConfig value) {
41  		this.botId = value.getBotId();
42  		this.teamNumber = value.getTeamNumber();
43  		this.skillLevel = value.getSkillLevel();
44  	}
45  
46  	@Override
47  	public IToken getBotId() {
48  		return botId;
49  	}
50  
51  	/**
52  	 * Sets ID of this bot configuration. This ID will be used for storing result of the tournament for this bot.
53  	 * <p><p>
54  	 * DOES NOT MEAN THAT THE EXECUTED BOT WILL HAVE THIS ID IN UT2004!
55  	 * 
56  	 * @param botId
57  	 */
58  	public UT2004NativeBotConfig setBotId(IToken botId) {
59  		this.botId = botId;
60  		return this;
61  	}
62  	
63  	/**
64  	 * Sets ID of this bot configuration. This ID will be used for storing result of the tournament for this bot.
65  	 * <p><p>
66  	 * DOES NOT MEAN THAT THE EXECUTED BOT WILL HAVE THIS ID IN UT2004!
67  	 * 
68  	 * @param botId
69  	 */
70  	public UT2004NativeBotConfig setBotId(String botId) {
71  		this.botId = Tokens.get(botId);
72  		return this;
73  	}
74  
75  	@Override
76  	public int getTeamNumber() {
77  		return teamNumber;
78  	}
79  
80  	/**
81  	 * Sets team number of the team the bot should join.
82  	 * @param teamNumber
83  	 * @return
84  	 */
85  	public UT2004NativeBotConfig setTeamNumber(int teamNumber) {
86  		this.teamNumber = teamNumber;
87  		return this;
88  	}
89  
90  	/**
91  	 * Skill level of the native bot.
92  	 * @return
93  	 */
94  	public int getSkillLevel() {
95  		return skillLevel;
96  	}
97  
98  	/**
99  	 * Sets desired skill level that the bot should have. From 1 to 7 (best). Default: 4.
100 	 * @param skillLevel
101 	 * @return
102 	 */
103 	public UT2004NativeBotConfig setSkillLevel(int skillLevel) {
104 		this.skillLevel = skillLevel;
105 		return this;
106 	}
107 
108 	public String getBotClass() {
109 		return botClass;
110 	}
111 	/** not used right now */
112 	public void setBotClass(String botClass) {
113 		this.botClass = botClass;		
114 	}
115 
116 }