1 package cz.cuni.amis.pogamut.ut2004.tag.tournament;
2
3 import java.util.ArrayList;
4 import java.util.HashMap;
5 import java.util.List;
6 import java.util.Map;
7
8 import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;
9 import cz.cuni.amis.pogamut.ut2004.analyzer.stats.UT2004AnalyzerObsStats;
10 import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.PlayerMessage;
11 import cz.cuni.amis.pogamut.ut2004.tag.server.BotTagRecord;
12 import cz.cuni.amis.pogamut.ut2004.tournament.match.UT2004MatchResult;
13 import cz.cuni.amis.utils.maps.HashMapMap;
14 import cz.cuni.amis.utils.token.IToken;
15
16 public class UT2004TagResult extends UT2004MatchResult {
17 private List<IToken> bots = new ArrayList<IToken>();
18
19 private List<IToken> nativeBots = new ArrayList<IToken>();
20
21 private Map<IToken, BotTagRecord<PlayerMessage>> playerScores = new HashMap<IToken, BotTagRecord<PlayerMessage>>();
22
23 private Map<UnrealId, Integer> tagsPassed = new HashMap<UnrealId, Integer>();
24
25 private Map<IToken, Integer> tagsReceived = new HashMap<IToken, Integer>();
26
27 private HashMapMap<IToken, IToken, Integer> tagCounts = new HashMapMap<IToken, IToken, Integer>();
28
29 private Map<IToken, UT2004AnalyzerObsStats> botObservers = new HashMap<IToken, UT2004AnalyzerObsStats>();
30
31
32
33
34 public double matchTimeEnd;
35
36
37
38
39 private boolean draw = false;
40
41 @Override
42 public String toString() {
43 return "UT2004TagGameResult[" + (isDraw() ? "DRAW" : (isIndividual() ? "winnerBot=" + getWinnerBot() : "winnerTeam=" + getWinnerTeam()) ) + "]";
44 }
45
46 public UT2004TagResult() {
47 super();
48 }
49
50 public UT2004TagResult(IToken winnerBot) {
51 super(winnerBot);
52 }
53
54
55
56
57
58
59 public Map<IToken, BotTagRecord<PlayerMessage>> getPlayerScores() {
60 return playerScores;
61 }
62
63
64
65
66
67 public void setPlayerScores(Map<IToken, BotTagRecord<PlayerMessage>> playerScores) {
68 this.playerScores = playerScores;
69 }
70
71
72
73
74
75 public List<IToken> getBots() {
76 return bots;
77 }
78
79
80
81
82
83 public void setBots(List<IToken> bots) {
84 this.bots = bots;
85 }
86
87
88
89
90
91 public List<IToken> getNativeBots() {
92 return nativeBots;
93 }
94
95
96
97
98
99 public void setNativeBots(List<IToken> nativeBots) {
100 this.nativeBots = nativeBots;
101 }
102
103
104
105
106
107 public List<IToken> getAllBots() {
108 List<IToken> all = new ArrayList<IToken>(this.bots);
109 all.addAll(this.nativeBots);
110 return all;
111 }
112
113
114
115
116 public double getMatchTimeEnd() {
117 return matchTimeEnd;
118 }
119
120
121
122
123 public void setMatchTimeEnd(double matchTimeEnd) {
124 this.matchTimeEnd = matchTimeEnd;
125 }
126
127
128
129
130
131 public HashMapMap<IToken, IToken, Integer> getTagCounts() {
132 return tagCounts;
133 }
134
135
136
137
138
139 public void setTagCounts(HashMapMap<IToken, IToken, Integer> tagCounts) {
140 this.tagCounts = tagCounts;
141 }
142
143
144
145
146
147
148 public Map<UnrealId, Integer> getTotalTags() {
149 return tagsPassed;
150 }
151
152
153
154
155
156 public void setTotalTags(Map<UnrealId, Integer> totalTags) {
157 this.tagsPassed = totalTags;
158 }
159
160
161
162
163
164 public Map<IToken, Integer> getWasTagged() {
165 return tagsReceived;
166 }
167
168
169
170
171
172 public void setWasTagged(Map<IToken, Integer> tagsReceived) {
173 this.tagsReceived = tagsReceived;
174 }
175
176
177
178
179
180
181 public Map<IToken, UT2004AnalyzerObsStats> getBotObservers() {
182 return botObservers;
183 }
184
185
186
187
188
189 public void setBotObservers(Map<IToken, UT2004AnalyzerObsStats> botObservers) {
190 this.botObservers = botObservers;
191 }
192 }