comparison src/main/java/alice/test/topology/aquarium/SendLocation.java @ 345:8f71c3e6f11d

Change directory structure Maven standard
author sugi
date Wed, 16 Apr 2014 18:26:07 +0900
parents
children aefbe41fcf12
comparison
equal deleted inserted replaced
344:9f97ec18f8c5 345:8f71c3e6f11d
1 package alice.test.topology.aquarium;
2
3 import alice.codesegment.CodeSegment;
4 import alice.datasegment.CommandType;
5 import alice.datasegment.Receiver;
6
7
8 public class SendLocation extends CodeSegment {
9
10 private Receiver position = ids.create(CommandType.PEEK);
11 float x;
12 float y;
13 float z;
14
15 public SendLocation(float x,float y,float z){
16 this.x = x;
17 this.y = y;
18 this.z = z;
19 position.setKey("fish");
20 }
21
22 @Override
23 public void run() {
24 FishPoint fp = this.position.asClass(FishPoint.class);
25 fp.setXYZ(fp.getX()+x, fp.getY()+y, fp.getZ()+z);
26 ods.update("fish", fp);
27
28 }
29
30 }