View Javadoc

1   package cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages;
2    		
3    		// --- IMPORTS FROM /messages/settings/javasettings/javaimport BEGIN
4   			import java.util.*;import javax.vecmath.*;import cz.cuni.amis.pogamut.base.communication.messages.*;import cz.cuni.amis.pogamut.base.communication.worldview.*;import cz.cuni.amis.pogamut.base.communication.worldview.event.*;import cz.cuni.amis.pogamut.base.communication.worldview.object.*;import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;import cz.cuni.amis.pogamut.base.communication.translator.event.*;import cz.cuni.amis.pogamut.multi.communication.translator.event.*;import cz.cuni.amis.pogamut.base3d.worldview.object.*;import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.*;import cz.cuni.amis.pogamut.ut2004.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.ItemType.Category;import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;import cz.cuni.amis.utils.exception.*;import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;import cz.cuni.amis.utils.SafeEquals;import cz.cuni.amis.pogamut.base.agent.*;import cz.cuni.amis.pogamut.multi.agent.*;import cz.cuni.amis.pogamut.multi.communication.worldview.property.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.property.*;import cz.cuni.amis.utils.token.*;import cz.cuni.amis.utils.*;
5   		// --- IMPORTS FROM /messages/settings/javasettings/javaimport END
6   		
7   		
8   		// --- IMPORTS FROM extra/code/java/javapart/classcategory[@name='all'] BEGIN
9   				
10  		// --- IMPORTS FROM extra/code/java/javapart/classcategory[@name='all'] END
11  		
12  		// --- IMPORTS FROM extra/code/java/javapart/classcategory[@name=event]+classtype[@name=impl] BEGIN
13  		
14  		// --- IMPORTS FROM extra/code/java/javapart/classcategory[@name=event]+classtype[@name=impl] END
15      
16   		/**
17           *  
18           			Definition of the event FAL.
19           		
20           *
21           *  <p></p><p></p>
22           *  Complete message documentation:               
23           *  
24  		Asynchronous message. This message represents case, where bot
25  		stands at the edge of cliff or somewhere the bot can fall. If
26  		the bot has ran, it is already falling. When the bot is walking
27  		he can't fall from the cliff, so after receiving this message, he
28  		is standing at the edge of the cliff.
29  	
30           */
31   	public class FallEdge 
32    				extends InfoMessage
33      			implements IWorldEvent, IWorldChangeEvent
34      			
35  	    {
36   	
37      	/** Example how the message looks like - used during parser tests. */
38      	public static final String PROTOTYPE =
39      		"FAL {Fell False}  {Location 0,0,0} ";
40      
41      	
42      	
43      	/**
44      	 * Parameter-less contructor for the message.
45      	 */
46  		public FallEdge()
47  		{
48  		}
49  	
50      	
51      	
52      	
53      	/**
54  		 * Creates new instance of the message FallEdge.
55  		 * 
56  		Asynchronous message. This message represents case, where bot
57  		stands at the edge of cliff or somewhere the bot can fall. If
58  		the bot has ran, it is already falling. When the bot is walking
59  		he can't fall from the cliff, so after receiving this message, he
60  		is standing at the edge of the cliff.
61  	
62  		 * Corresponding GameBots message
63  		 *   
64  		 *   is
65  		 *   FAL.
66  		 * 
67   	  	 * 
68  		 *   
69  		 *     @param Fell 
70  			Flag for falling, if true, then the bot is already falling.
71  		
72  		 *   
73  		 * 
74  		 *   
75  		 *     @param Location Current location of the bot.
76  		 *   
77  		 * 
78  		 */
79  		public FallEdge(
80  			boolean Fell,  Location Location
81  		) {
82  			
83  					this.Fell = Fell;
84  				
85  					this.Location = Location;
86  				
87  		}
88      
89      	/**
90  		 * Cloning constructor from the full message.
91  		 *
92  		 * @param original
93  		 */
94  		public FallEdge(FallEdge original) {		
95  			
96  					this.Fell = original.isFell()
97   	;
98  				
99  					this.Location = original.getLocation()
100  	;
101 				
102 			this.SimTime = original.getSimTime();			
103 		}
104 		
105 	   		
106 			protected long SimTime;
107 				
108 			/**
109 			 * Simulation time in MILLI SECONDS !!!
110 			 */	
111 			@Override
112 			public long getSimTime() {
113 				return SimTime;
114 			}
115 						
116 			/**
117 			 * Used by Yylex to slip correct time of the object or programmatically.
118 			 */
119 			protected void setSimTime(long SimTime) {
120 				this.SimTime = SimTime;
121 			}
122 	   	
123     	
124 	    /**
125          * 
126 			Flag for falling, if true, then the bot is already falling.
127 		 
128          */
129         protected
130          boolean Fell =
131        	false;
132 	
133  		/**
134          * 
135 			Flag for falling, if true, then the bot is already falling.
136 		 
137          */
138         public  boolean isFell()
139  	 {
140     					return Fell;
141     				}
142     			
143     	
144 	    /**
145          * Current location of the bot. 
146          */
147         protected
148          Location Location =
149        	null;
150 	
151  		/**
152          * Current location of the bot. 
153          */
154         public  Location getLocation()
155  	 {
156     					return Location;
157     				}
158     			
159  		
160  	    public String toString() {
161             return
162             	super.toString() + "[" +
163             	
164 		              			"Fell = " + String.valueOf(isFell()
165  	) + " | " + 
166 		              		
167 		              			"Location = " + String.valueOf(getLocation()
168  	) + " | " + 
169 		              		
170 				"]";           		
171         }
172  	
173  		
174  		public String toHtmlString() {
175  			return super.toString() + "[<br/>" +
176             	
177 		              			"<b>Fell</b> = " + String.valueOf(isFell()
178  	) + " <br/> " + 
179 		              		
180 		              			"<b>Location</b> = " + String.valueOf(getLocation()
181  	) + " <br/> " + 
182 		              		
183 				"<br/>]";     
184 		}
185  	 
186  	    public String toJsonLiteral() {
187             return "FallEdge(null, "
188             		
189                    + ")";
190         }
191  	
192  		
193  		// --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
194         	
195 		// --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
196 		
197 	    // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=event+classtype[@name=impl]) ---
198 	        
199 	    // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=event+classtype[@name=impl]) ---        	            	
200  	
201 		}
202