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 public class PlaySound
21 extends CommandMessage
22 {
23
24
25
26 public static final String PROTOTYPE =
27 " {Player text} {Sound text} ";
28
29
30
31
32
33
34
35
36
37
38
39
40
41 public PlaySound(
42 String Player, String Sound
43 ) {
44
45 this.Player = Player;
46
47 this.Sound = Sound;
48
49 }
50
51
52
53
54
55
56
57
58
59
60
61
62 public PlaySound() {
63 }
64
65
66
67
68
69
70
71 public PlaySound(PlaySound original) {
72
73 this.Player = original.Player;
74
75 this.Sound = original.Sound;
76
77 }
78
79
80
81
82 protected
83 String Player =
84
85 null
86 ;
87
88
89
90
91
92
93 public String getPlayer()
94
95 {
96 return
97 Player;
98 }
99
100
101
102
103
104
105
106 public PlaySound
107 setPlayer(String Player)
108
109 {
110 this.Player = Player;
111 return this;
112 }
113
114
115
116
117 protected
118 String Sound =
119
120 null
121 ;
122
123
124
125
126
127
128 public String getSound()
129
130 {
131 return
132 Sound;
133 }
134
135
136
137
138
139
140
141 public PlaySound
142 setSound(String Sound)
143
144 {
145 this.Sound = Sound;
146 return this;
147 }
148
149 public String toString() {
150 return toMessage();
151 }
152
153 public String toHtmlString() {
154 return super.toString() + "[<br/>" +
155
156 "<b>Player</b> = " +
157 String.valueOf(getPlayer()
158 ) +
159 " <br/> " +
160
161 "<b>Sound</b> = " +
162 String.valueOf(getSound()
163 ) +
164 " <br/> " +
165
166 "<br/>]"
167 ;
168 }
169
170 public String toMessage() {
171 StringBuffer buf = new StringBuffer();
172 buf.append("PLSND");
173
174 if (Player != null) {
175 buf.append(" {Player " + Player + "}");
176 }
177
178 if (Sound != null) {
179 buf.append(" {Sound " + Sound + "}");
180 }
181
182 return buf.toString();
183 }
184
185
186
187
188
189 }
190