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   * Informs about change in defcon.
29   */
30  public class DefConChanged extends DefConEvent {
31      /**
32       * Old defcon.
33       */
34      private int oldDefCon = 0;
35  
36      /**
37       * New defcon.
38       */
39      private int newDefCon = 0;
40  
41  /**
42                            Creates new instance of message DefConChanged.
43                            
44                  Informs about change in defcon.
45          
46                       @param
47                        oldDefCon Old defcon.
48                       @param
49                        newDefCon New defcon.
50              @param time
51                   */
52      public DefConChanged(int oldDefCon, int newDefCon, double time) {
53          super(time);
54  
55          this.oldDefCon = oldDefCon;
56  
57          this.newDefCon = newDefCon;
58      }
59  
60      /**
61       * Old defcon.
62       *
63       * @return int
64       */
65      public int getOldDefCon() {
66          return this.oldDefCon;
67      }
68  
69      /**
70       * New defcon.
71       *
72       * @return int
73       */
74      public int getNewDefCon() {
75          return this.newDefCon;
76      }
77  
78      /**
79       * Returns human readable serialization of the message.
80       *
81       * @return human readable string
82       */
83      @Override
84      public String toString() {
85          return "DefConChanged[" + getStringizedFields() + "; OldDefCon = " + this.oldDefCon +
86          "; NewDefCon = " + this.newDefCon + "]";
87      }
88  
89      /**
90       * Returns message in html format.
91       *
92       * @return html message
93       */
94      public String toHtmlString() {
95          return "<p><b>DefConChanged:</b></p>" + "<p><i>OldDefCon:</i> " + this.oldDefCon + "</p>" +
96          "<p><i>NewDefCon:</i> " + this.newDefCon + "</p>";
97      }
98  }