1
2
3
4
5
6
7
8
9
10 package
11 cz.cuni.amis.pogamut.udk.communication.messages.gbcommands;
12 import java.util.*;
13 import javax.vecmath.*;
14 import cz.cuni.amis.pogamut.base.communication.messages.*;
15 import cz.cuni.amis.pogamut.base.communication.worldview.*;
16 import cz.cuni.amis.pogamut.base.communication.worldview.event.*;
17 import cz.cuni.amis.pogamut.base.communication.worldview.object.*;
18 import cz.cuni.amis.pogamut.base.communication.translator.event.*;
19 import cz.cuni.amis.pogamut.base3d.worldview.object.*;
20 import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;
21 import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;
22 import cz.cuni.amis.pogamut.udk.communication.messages.*;
23 import cz.cuni.amis.pogamut.udk.communication.worldview.objects.*;
24 import cz.cuni.amis.pogamut.udk.communication.translator.itemdescriptor.*;
25 import cz.cuni.amis.pogamut.udk.communication.messages.ItemType.Category;
26 import cz.cuni.amis.utils.exception.*;
27 import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;
28 import cz.cuni.amis.utils.SafeEquals;
29 import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 public class
46 AddInventory extends
47 CommandMessage
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 public AddInventory(
73 UnrealId Id, String Type) {
74
75 this.Id = Id;
76
77 this.Type = Type;
78
79 }
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94 public AddInventory() {
95 }
96
97
98
99
100
101
102
103
104
105
106
107 protected
108 UnrealId Id =
109 null;
110
111
112
113
114
115
116
117
118
119 public
120 UnrealId getId() {
121 return
122 Id;
123 }
124
125
126
127
128
129
130
131
132
133
134 public AddInventory setId(UnrealId Id) {
135 this.Id = Id;
136 return this;
137 }
138
139
140
141
142
143
144 protected
145 String Type =
146 null;
147
148
149
150
151
152
153
154 public
155 String getType() {
156 return
157 Type;
158 }
159
160
161
162
163
164
165
166
167 public AddInventory setType(String Type) {
168 this.Type = Type;
169 return this;
170 }
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193 public AddInventory(AddInventory original) {
194
195 this.Id=original.Id;
196
197 this.Type=original.Type;
198
199 }
200
201
202
203
204 public String toString() {
205 return
206
207 toMessage();
208
209 }
210
211 public String toHtmlString() {
212 return super.toString() +
213
214 "<b>Id</b> : " +
215 String.valueOf(Id) +
216 " <br/> " +
217
218 "<b>Type</b> : " +
219 String.valueOf(Type) +
220 " <br/> " +
221 "";
222 }
223
224
225
226 public String toMessage() {
227 StringBuffer buf = new StringBuffer();
228 buf.append("ADDINV");
229
230 if (Id != null) {
231 buf.append(" {Id " + Id.getStringId() + "}");
232 }
233
234 if (Type != null) {
235 buf.append(" {Type " + Type + "}");
236 }
237
238 return buf.toString();
239 }
240
241 }
242
243