Mercurial > hg > Database > Alice
comparison src/main/java/alice/test/topology/aquarium/fx/CheckAllFishInfoExist.java @ 529:cb7c31848d16 dispose
add CompressedDSMs
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 01 May 2015 18:19:16 +0900 |
parents | 6e304a7a60e7 |
children | 0832af83583f |
comparison
equal
deleted
inserted
replaced
528:6ebddfac7ff6 | 529:cb7c31848d16 |
---|---|
8 import org.msgpack.MessagePack; | 8 import org.msgpack.MessagePack; |
9 import org.msgpack.type.ArrayValue; | 9 import org.msgpack.type.ArrayValue; |
10 import org.msgpack.type.Value; | 10 import org.msgpack.type.Value; |
11 | 11 |
12 import alice.codesegment.CodeSegment; | 12 import alice.codesegment.CodeSegment; |
13 import alice.codesegment.SingletonMessage; | |
14 import alice.datasegment.CommandType; | 13 import alice.datasegment.CommandType; |
15 import alice.datasegment.Receiver; | 14 import alice.datasegment.Receiver; |
16 | 15 |
17 public class CheckAllFishInfoExist extends CodeSegment { | 16 public class CheckAllFishInfoExist extends CodeSegment { |
18 // this CS check all fish object exist in scene | 17 // this CS check all fish object exist in scene |
29 public void run() { | 28 public void run() { |
30 try { | 29 try { |
31 new SendDataOthers(info, info.key); | 30 new SendDataOthers(info, info.key); |
32 ods.put("registeredList", info.getVal()); | 31 ods.put("registeredList", info.getVal()); |
33 ArrayValue fishInfoList = info.asClass(Value.class).asArrayValue(); | 32 ArrayValue fishInfoList = info.asClass(Value.class).asArrayValue(); |
34 MessagePack msg = SingletonMessage.getInstance(); | 33 MessagePack packer = new MessagePack(); |
35 Group root = info1.asClass(Group.class); | 34 Group root = info1.asClass(Group.class); |
36 for (Value v : fishInfoList){ | 35 for (Value v : fishInfoList){ |
37 boolean exist = false; | 36 boolean exist = false; |
38 FishInfo info = msg.convert(v, FishInfo.class); | 37 FishInfo info = packer.convert(v, FishInfo.class); |
39 if (info.name != null) { | 38 if (info.name != null) { |
40 for (Node n : root.getChildren()) { | 39 for (Node n : root.getChildren()) { |
41 if (info.name.equals(n.getId())) { | 40 if (info.name.equals(n.getId())) { |
42 exist = true; | 41 exist = true; |
43 break; | 42 break; |