107
|
1 package alice.test.topology.fishmodel.alpha;
|
92
|
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
|
97
|
10 public Receiver position = ids.create(CommandType.PEEK);
|
|
11 float x;
|
|
12 float y;
|
92
|
13
|
97
|
14 public SendLocation(float x,float y){
|
|
15 this.x = x;
|
|
16 this.y = y;
|
92
|
17 }
|
|
18
|
|
19 @Override
|
|
20 public void run() {
|
97
|
21 FishPoint FP = this.position.asClass(FishPoint.class);
|
|
22 FP.setXY(FP.getX()+this.x, FP.getY()+this.y);
|
105
|
23 ods.update("local", "fish", FP);
|
92
|
24
|
|
25 }
|
|
26
|
|
27 }
|