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  		Asynchronous message. A player joined the game.
35  	
36                            Corresponding GameBots message is
37                            JOIN.
38                        
39               */
40              
41              public class
42              PlayerJoinsGame
43                      extends GBEvent
44                  
45  	            	implements IWorldEvent, IWorldChangeEvent
46  
47              {
48              
49              /**
50                Creates new instance of command PlayerJoinsGame.
51                
52  		Asynchronous message. A player joined the game.
53  	Corresponding GameBots message for this command is
54                .
55                    @param Id Unique Id of the player.
56                    @param Name Name of the player.
57                */
58               public PlayerJoinsGame(
59                  UnrealId Id,  String Name) {
60                      
61                      this.Id = Id;
62                  
63                      this.Name = Name;
64                  
65                  }
66  
67              
68      	/** Example how the message looks like - used during parser tests. */
69      	public static final String PROTOTYPE =
70      		"JOIN {Id unreal_id} {Name text}";
71      
72  
73              /////// Properties BEGIN
74              
75          /**
76          Unique Id of the player. */
77          protected
78           UnrealId Id =
79          	null;
80  
81          
82          /**
83          Unique Id of the player. */
84          public
85          UnrealId getId() {
86              return
87           Id;
88          }
89          
90  
91          
92          /**
93          Name of the player. */
94          protected
95           String Name =
96          	null;
97  
98          
99          /**
100         Name of the player. */
101         public
102         String getName() {
103             return
104          Name;
105         }
106         
107 
108         
109             /////// Properties END
110 
111             /////// Extra Java code BEGIN
112 
113             	/////// Additional code from xslt BEGIN
114             		
115        					public long getSimTime() {
116        						// NOT IMPLEMENTED FOR UDK
117        						return 0;
118        					}
119             		
120 
121 
122             	/////// Additional code from xslt END
123 
124 	            /////// Extra Java from XML BEGIN
125             		
126             	/////// Extra Java from XML END
127 
128             /////// Extra Java code END
129 
130             
131 
132             /**
133               * Cloning constructor.
134               */
135              public PlayerJoinsGame(PlayerJoinsGame original) {
136                 
137                      this.Id=original.Id;
138                 
139                      this.Name=original.Name;
140                 
141              }
142 
143              
144                  /**
145                   * Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
146                   */
147 	             public PlayerJoinsGame() {
148 	             }
149              
150 
151                  
152             public String toString() {
153                 return
154                 
155                 		super.toString() + " | " +
156                 		
157 				               "Id = " +
158 				               String.valueOf(Id) + " | " +
159 				            
160 				               "Name = " +
161 				               String.valueOf(Name) + " | " +
162 				             "";
163                 	
164              }
165 
166              public String toHtmlString() {
167                 return super.toString() +
168             
169             "<b>Id</b> : " +
170             String.valueOf(Id) +
171             " <br/> " +
172             
173             "<b>Name</b> : " +
174             String.valueOf(Name) +
175             " <br/> " +
176              "";
177              }
178 
179              
180              
181              }
182 
183