1
2
3
4
5
6
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
29
30 public class Carrier extends DefConUnitObject<CarrierState> {
31
32
33
34 @Updatable
35 private int nukeSupply = 0;
36
37
38
39
40 @Updatable
41 private int fighterSupply = 0;
42
43
44
45
46 @Updatable
47 private int bomberSupply = 0;
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76 public Carrier(int id, int teamId, DefConLocation location, boolean visible,
77 CarrierState state, int stateCount, int target, int nukeSupply, int fighterSupply,
78 int bomberSupply, double time) {
79 super(id, UnitType.CARRIER, teamId, location, visible, state, stateCount, target, time);
80
81 this.nukeSupply = nukeSupply;
82
83 this.fighterSupply = fighterSupply;
84
85 this.bomberSupply = bomberSupply;
86 }
87
88
89
90
91
92 public Carrier(Carrier original) {
93 super(original);
94
95 this.nukeSupply = original.nukeSupply;
96
97 this.fighterSupply = original.fighterSupply;
98
99 this.bomberSupply = original.bomberSupply;
100 }
101
102
103
104
105
106
107 public int getNukeSupply() {
108 return this.nukeSupply;
109 }
110
111
112
113
114
115
116 public int getFighterSupply() {
117 return this.fighterSupply;
118 }
119
120
121
122
123
124
125 public int getBomberSupply() {
126 return this.bomberSupply;
127 }
128
129
130
131
132
133
134 @Override
135 public String toString() {
136 return "Carrier[" + getStringizedFields() + "; NukeSupply = " + this.nukeSupply +
137 "; FighterSupply = " + this.fighterSupply + "; BomberSupply = " + this.bomberSupply + "]";
138 }
139
140
141
142
143
144
145 public String toHtmlString() {
146 return "<p><b>Carrier:</b></p>" + "<p><i>NukeSupply:</i> " + this.nukeSupply + "</p>" +
147 "<p><i>FighterSupply:</i> " + this.fighterSupply + "</p>" + "<p><i>BomberSupply:</i> " +
148 this.bomberSupply + "</p>";
149 }
150 }