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   * Bomber unit from the world.
29   */
30  public class Bomber extends DefConUnitObject<BomberState> {
31      /**
32       * Bomber's current nuke target.
33       */
34      @Updatable
35      private DefConLocation nukeTarget = null;
36  
37  /**
38                                    Creates new instance of object Bomber with specific id.
39                                    
40                  Bomber unit 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            @param state DefCon state of this unit.
47            @param stateCount Number of activations of current state on this unit.
48            @param target Current target of this unit.
49                            
50                               @param
51                                nukeTarget 
52                          Bomber's current nuke target.
53                                       
54            @param time Time of last update of this object (time of first spotting in this case). 
55                           */
56      public Bomber(int id, int teamId, DefConLocation location, boolean visible, BomberState state,
57          int stateCount, int target, DefConLocation nukeTarget, double time) {
58          super(id, UnitType.BOMBER, teamId, location, visible, state, stateCount, target, time);
59  
60          this.nukeTarget = nukeTarget;
61      }
62  
63  /**
64                                   * Cloning constructor...
65                                   * @param original
66                                   */
67      public Bomber(Bomber original) {
68          super(original);
69  
70          this.nukeTarget = original.nukeTarget;
71      }
72  
73      /**
74       * Bomber's current nuke target.
75       *
76       * @return DefConLocation
77       */
78      public DefConLocation getNukeTarget() {
79          return this.nukeTarget;
80      }
81  
82      /**
83       * Returns human readable serialization of the message.
84       *
85       * @return human readable string
86       */
87      @Override
88      public String toString() {
89          return "Bomber[" + getStringizedFields() + "; NukeTarget = " + this.nukeTarget + "]";
90      }
91  
92      /**
93       * Returns message in html format.
94       *
95       * @return html message
96       */
97      public String toHtmlString() {
98          return "<p><b>Bomber:</b></p>" + "<p><i>NukeTarget:</i> " + this.nukeTarget + "</p>";
99      }
100 }