View Javadoc

1   /*
2      IMPORTANT !!!
3   
4      DO NOT EDIT THIS FILE. IT IS GENERATED FROM APPROPRIATE XML FILE
5      BY THE MessagesGenerator.xslt.
6      MODIFY THAT FILE INSTEAD OF THIS ONE.
7   
8    */
9   package cz.cuni.amis.pogamut.defcon.communication.messages.infos;
10  
11  import cz.cuni.amis.pogamut.base.communication.messages.*;
12  import cz.cuni.amis.pogamut.base.communication.worldview.*;
13  import cz.cuni.amis.pogamut.base.communication.worldview.object.*;
14  import cz.cuni.amis.pogamut.defcon.base3d.worldview.object.DefConLocation;
15  import cz.cuni.amis.pogamut.defcon.communication.messages.*;
16  import cz.cuni.amis.pogamut.defcon.communication.messages.commands.*;
17  import cz.cuni.amis.pogamut.defcon.communication.messages.infos.*;
18  import cz.cuni.amis.pogamut.defcon.consts.*;
19  import cz.cuni.amis.pogamut.defcon.consts.state.*;
20  import cz.cuni.amis.utils.exception.*;
21  
22  import java.util.*;
23  
24  import javabot.*;
25  
26  
27  /**
28   * Fleet object from the world.
29   */
30  public class Fleet extends DefConViewableObject {
31      /**
32       * An array of fleet members.
33       */
34      @Updatable
35      private int[] fleetMembers = null;
36  
37  /**
38                                    Creates new instance of object Fleet with specific id.
39                                    
40                  Fleet object from the world.
41          
42                                    @param id        Game id of this object.
43            @param teamId Id of this object's team.
44            @param location Location of this object.
45            @param visible Visibility of this object.
46                            
47                               @param
48                                fleetMembers 
49                          An array of fleet members.
50                            
51            @param time Time of last update of this object (time of first spotting in this case). 
52                           */
53      public Fleet(int id, int teamId, DefConLocation location, boolean visible, int[] fleetMembers,
54          double time) {
55          super(id, UnitType.FLEET, teamId, location, visible, time);
56  
57          this.fleetMembers = fleetMembers;
58      }
59  
60  /**
61                                   * Cloning constructor...
62                                   * @param original
63                                   */
64      public Fleet(Fleet original) {
65          super(original);
66  
67          this.fleetMembers = original.fleetMembers;
68      }
69  
70      /**
71       * An array of fleet members.
72       *
73       * @return int[]
74       */
75      public int[] getFleetMembers() {
76          return this.fleetMembers;
77      }
78  
79      /**
80       * Returns human readable serialization of the message.
81       *
82       * @return human readable string
83       */
84      @Override
85      public String toString() {
86          return "Fleet[" + getStringizedFields() + "; FleetMembers = " + this.fleetMembers + "]";
87      }
88  
89      /**
90       * Returns message in html format.
91       *
92       * @return html message
93       */
94      public String toHtmlString() {
95          return "<p><b>Fleet:</b></p>" + "<p><i>FleetMembers:</i> " + this.fleetMembers + "</p>";
96      }
97  }