111
|
1 package alice.test.topology.fishmodel.alpha;
|
|
2
|
|
3 import alice.codesegment.CodeSegment;
|
|
4 import alice.datasegment.CommandType;
|
|
5 import alice.datasegment.Receiver;
|
|
6
|
|
7 public class AutoIncrement extends CodeSegment {
|
|
8
|
|
9 public Receiver position = ids.create(CommandType.PEEK);
|
|
10 String key;
|
|
11
|
|
12 public AutoIncrement(String key,int index){
|
|
13
|
|
14 this.key = key;
|
|
15 this.position.setKey("local", key);
|
|
16
|
|
17 }
|
|
18
|
|
19 @Override
|
114
|
20 public void run() {
|
111
|
21 FishPoint FP = this.position.asClass(FishPoint.class);
|
|
22 FP.setXY(FP.getX()+0.01f, FP.getY());
|
|
23 ods.update("local", key, FP);
|
114
|
24
|
111
|
25 new AutoIncrement(this.key,this.position.index);
|
|
26
|
|
27 }
|
|
28
|
|
29 }
|