View Javadoc

1   
2               /**
3               IMPORTANT !!!
4   
5               DO NOT EDIT THIS FILE. IT IS GENERATED FROM approriate xml file in xmlresources/gbinfomessages BY
6               THE JavaClassesGenerator.xslt. MODIFY THESE FILES INSTEAD OF THIS ONE.
7   
8               IMPORTANT END !!!
9               */
10              package
11              cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages;
12  	    		import java.util.*;
13      import javax.vecmath.*;
14      import cz.cuni.amis.pogamut.base.communication.messages.*;
15      import cz.cuni.amis.pogamut.base.communication.worldview.*;
16      import cz.cuni.amis.pogamut.base.communication.worldview.event.*;
17      import cz.cuni.amis.pogamut.base.communication.worldview.object.*;
18      import cz.cuni.amis.pogamut.base.communication.translator.event.*;
19      import cz.cuni.amis.pogamut.base3d.worldview.object.*;
20      import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;
21      import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;
22      import cz.cuni.amis.pogamut.udk.communication.messages.*;
23      import cz.cuni.amis.pogamut.udk.communication.worldview.objects.*;
24      import cz.cuni.amis.pogamut.udk.communication.translator.itemdescriptor.*;
25      import cz.cuni.amis.pogamut.udk.communication.messages.ItemType.Category;
26      import cz.cuni.amis.utils.exception.*;
27      import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;
28      import cz.cuni.amis.utils.SafeEquals;
29      import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;
30      
31              
32              /**
33                
34  		Synchronous message. Contains the info about player score.
35  	
36                            Corresponding GameBots message is
37                            PLS.
38                        
39               */
40              
41              public class
42              PlayerScore
43                      extends GBEvent
44                  
45  	            	implements IWorldEvent, IWorldChangeEvent
46  
47              {
48              
49              /**
50                Creates new instance of command PlayerScore.
51                
52  		Synchronous message. Contains the info about player score.
53  	Corresponding GameBots message for this command is
54                .
55                    @param lastSeenTime 
56  			When was the last time we've received info about this
57  			object.
58  		
59                    @param Id Unique Id of the player.
60                    @param Score 
61  			Number of player frags (how many times the player killed
62  			other players) or number of victory points (player frags +
63  			some special measurement that can differ from game type to
64  			game type).
65  		
66                    @param Deaths Number of players deaths.
67                */
68               public PlayerScore(
69                  double lastSeenTime,  UnrealId Id,  int Score,  int Deaths) {
70                      
71                      this.lastSeenTime = lastSeenTime;
72                  
73                      this.Id = Id;
74                  
75                      this.Score = Score;
76                  
77                      this.Deaths = Deaths;
78                  
79                  }
80  
81              
82      	/** Example how the message looks like - used during parser tests. */
83      	public static final String PROTOTYPE =
84      		"PLS {Id unreal_id} {Score 0} {Deaths 0}";
85      
86  
87              /////// Properties BEGIN
88              
89          /**
90          
91  			When was the last time we've received info about this
92  			object.
93  		 */
94          protected
95           double lastSeenTime =
96          	0;
97  
98          
99          /**
100         
101 			When was the last time we've received info about this
102 			object.
103 		 */
104         public
105         double getLastSeenTime() {
106             return
107          lastSeenTime;
108         }
109         
110 
111         
112         /**
113         Unique Id of the player. */
114         protected
115          UnrealId Id =
116         	null;
117 
118         
119         /**
120         Unique Id of the player. */
121         public
122         UnrealId getId() {
123             return
124          Id;
125         }
126         
127 
128         
129         /**
130         
131 			Number of player frags (how many times the player killed
132 			other players) or number of victory points (player frags +
133 			some special measurement that can differ from game type to
134 			game type).
135 		 */
136         protected
137          int Score =
138         	0;
139 
140         
141         /**
142         
143 			Number of player frags (how many times the player killed
144 			other players) or number of victory points (player frags +
145 			some special measurement that can differ from game type to
146 			game type).
147 		 */
148         public
149         int getScore() {
150             return
151          Score;
152         }
153         
154 
155         
156         /**
157         Number of players deaths. */
158         protected
159          int Deaths =
160         	0;
161 
162         
163         /**
164         Number of players deaths. */
165         public
166         int getDeaths() {
167             return
168          Deaths;
169         }
170         
171 
172         
173             /////// Properties END
174 
175             /////// Extra Java code BEGIN
176 
177             	/////// Additional code from xslt BEGIN
178             		
179        					public long getSimTime() {
180        						// NOT IMPLEMENTED FOR UDK
181        						return 0;
182        					}
183             		
184 
185 
186             	/////// Additional code from xslt END
187 
188 	            /////// Extra Java from XML BEGIN
189             		
190             	/////// Extra Java from XML END
191 
192             /////// Extra Java code END
193 
194             
195 
196             /**
197               * Cloning constructor.
198               */
199              public PlayerScore(PlayerScore original) {
200                 
201                      this.lastSeenTime=original.lastSeenTime;
202                 
203                      this.Id=original.Id;
204                 
205                      this.Score=original.Score;
206                 
207                      this.Deaths=original.Deaths;
208                 
209              }
210 
211              
212                  /**
213                   * Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
214                   */
215 	             public PlayerScore() {
216 	             }
217              
218 
219                  
220             public String toString() {
221                 return
222                 
223                 		super.toString() + " | " +
224                 		
225 				               "Id = " +
226 				               String.valueOf(Id) + " | " +
227 				            
228 				               "Score = " +
229 				               String.valueOf(Score) + " | " +
230 				            
231 				               "Deaths = " +
232 				               String.valueOf(Deaths) + " | " +
233 				             "";
234                 	
235              }
236 
237              public String toHtmlString() {
238                 return super.toString() +
239             
240             "<b>lastSeenTime</b> : " +
241             String.valueOf(lastSeenTime) +
242             " <br/> " +
243             
244             "<b>Id</b> : " +
245             String.valueOf(Id) +
246             " <br/> " +
247             
248             "<b>Score</b> : " +
249             String.valueOf(Score) +
250             " <br/> " +
251             
252             "<b>Deaths</b> : " +
253             String.valueOf(Deaths) +
254             " <br/> " +
255              "";
256              }
257 
258              
259              
260              }
261 
262