1010
1111import cn .jsmod2 .core .ApiId ;
1212import cn .jsmod2 .core .math .Vector ;
13+ import cn .jsmod2 .network .DoGetStream ;
14+ import cn .jsmod2 .network .DoStream ;
15+ import cn .jsmod2 .network .SimpleGetStream ;
16+ import cn .jsmod2 .network .protocol .event .newstream .GetTypes ;
1317
1418import java .io .Serializable ;
19+ import java .util .List ;
1520
1621
1722/**
@@ -28,59 +33,67 @@ public class Room extends ApiId implements IRoom, Serializable,Cloneable {
2833 private Vector speakerPosition ;
2934
3035 public void flickerLights (){
31-
36+ DoStream stream = new DoStream ();
37+ stream .method = "FlickerLights" ;
38+ stream .playerName = playerName ;
39+ stream .send ();
3240 }
3341
3442 public ZoneType getZoneType () {
43+ SimpleGetStream stream = new SimpleGetStream (ZoneType .class );
44+ zoneType = stream .read (playerName ,"ZoneType" ,ZoneType .class );
3545 return zoneType ;
3646 }
3747
3848
3949
4050 public RoomType getRoomType () {
51+ SimpleGetStream stream = new SimpleGetStream (RoomType .class );
52+ roomType = stream .read (playerName ,"RoomType" ,RoomType .class );
4153 return roomType ;
4254 }
4355
4456
4557
4658 public int getGenericID () {
59+ SimpleGetStream stream = new SimpleGetStream (Integer .class );
60+ genericID = stream .read (playerName ,"GenericID" ,Integer .class );
4761 return genericID ;
4862 }
4963
5064
51-
5265 public Vector getPosition () {
66+ SimpleGetStream stream = new SimpleGetStream (Vector .class );
67+ position = stream .read (playerName ,"Position" ,Vector .class );
5368 return position ;
5469 }
5570
5671
5772
5873 public Vector getForward () {
74+ SimpleGetStream stream = new SimpleGetStream (Vector .class );
75+ forward = stream .read (playerName ,"Forward" ,Vector .class );
5976 return forward ;
6077 }
6178
6279 public Vector getSpeakerPosition () {
80+ SimpleGetStream stream = new SimpleGetStream (Vector .class );
81+ speakerPosition = stream .read (playerName ,"SpeakerPosition" ,Vector .class );
6382 return speakerPosition ;
6483 }
6584
6685 public String [] getObjectName (){
67- return null ;
86+ DoGetStream stream = new DoGetStream (String .class );
87+ stream .playerName = playerName ;
88+ stream .getType = GetTypes .GET_ARRAY ;
89+ stream .method = "GetObjectName" ;
90+ return (String []) ((List )stream .send ()).toArray ();
6891 }
6992
7093 //这里未来解决
7194 public Object getGameObject (){
7295 return null ;
7396 }
7497
75- @ Override
76- public String toString () {
77- return "Room{" +
78- "zoneType=" + zoneType +
79- ", roomType=" + roomType +
80- ", genericID=" + genericID +
81- ", position=" + position +
82- ", forward=" + forward +
83- ", speakerPosition=" + speakerPosition +
84- '}' ;
85- }
98+
8699}
0 commit comments