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