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=shared]+classtype[@name=abstract] BEGIN
13  		
14  		// --- IMPORTS FROM extra/code/java/javapart/classcategory[@name=shared]+classtype[@name=abstract] END
15      
16   		/**
17           *  
18              				Abstract definition of the shared part of the GameBots2004 message TES.  
19              			
20           *
21           *  <p></p><p></p>
22           *  Complete message documentation:               
23           *  
24  		Synchronous message. Contains the info about team score.
25  	
26           */
27   	public abstract class TeamScoreShared 
28    						extends InfoMessage
29    						implements ISharedWorldObject
30    						
31  	    {
32   	
33      	
34      	
35      	/**
36      	 * Parameter-less contructor for the message.
37      	 */
38  		public TeamScoreShared()
39  		{
40  		}
41  		
42  				// abstract definition of the shared-part of the message, no more constructors is needed
43  			
44  	   		
45  			protected long SimTime;
46  				
47  			/**
48  			 * Simulation time in MILLI SECONDS !!!
49  			 */	
50  			@Override
51  			public long getSimTime() {
52  				return SimTime;
53  			}
54  						
55  			/**
56  			 * Used by Yylex to slip correct time of the object or programmatically.
57  			 */
58  			protected void setSimTime(long SimTime) {
59  				this.SimTime = SimTime;
60  			}
61  	   	
62  	    						public static final Token TeamPropertyToken = Tokens.get("Team");
63  	    					
64  	    						public static final Token ScorePropertyToken = Tokens.get("Score");
65  	    						
66  							
67  							public static final Set<Token> SharedPropertyTokens;
68  	
69  							static {
70  								Set<Token> tokens = new HashSet<Token>();
71  								
72  									tokens.add(TeamPropertyToken);
73  								
74  									tokens.add(ScorePropertyToken);
75  								
76  								SharedPropertyTokens = Collections.unmodifiableSet(tokens);
77  							}
78  	    				
79  	    			
80  	    				@Override
81  		    			public abstract 
82  		    			TeamScoreShared clone();
83  		    			
84  						@Override
85  						public Class getCompositeClass() {
86  							return TeamScore.class;
87  						}
88  	
89  						
90  		    			
91   		/**
92           * Message identifier. 
93           */
94          public abstract UnrealId getId()
95   	;
96  		    			
97   		/**
98           * Team identifier. 
99           */
100         public abstract Integer getTeam()
101  	;
102 		    			
103  		/**
104          * 
105 			The score of the team (can be some special measurement that
106 			differs from game type to game type - number of stolen flags
107 			in CTF game, number of team frags in TeamGame, etc.)
108 		 
109          */
110         public abstract Integer getScore()
111  	;
112 		    			
113  		
114  	    public String toString() {
115             return
116             	super.toString() + "[" +
117             	
118 		              			"Id = " + String.valueOf(getId()
119  	) + " | " + 
120 		              		
121 		              			"Team = " + String.valueOf(getTeam()
122  	) + " | " + 
123 		              		
124 		              			"Score = " + String.valueOf(getScore()
125  	) + " | " + 
126 		              		
127 				"]";           		
128         }
129  	
130  		
131  		public String toHtmlString() {
132  			return super.toString() + "[<br/>" +
133             	
134 		              			"<b>Id</b> = " + String.valueOf(getId()
135  	) + " <br/> " + 
136 		              		
137 		              			"<b>Team</b> = " + String.valueOf(getTeam()
138  	) + " <br/> " + 
139 		              		
140 		              			"<b>Score</b> = " + String.valueOf(getScore()
141  	) + " <br/> " + 
142 		              		
143 				"<br/>]";     
144 		}
145  	
146  		
147  		// --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
148         	
149 		// --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
150 		
151 	    // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=shared+classtype[@name=abstract]) ---
152 	        
153 	    // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=shared+classtype[@name=abstract]) ---        	            	
154  	
155 		}
156