134
|
1 package alice.test.topology.aquarium;
|
91
|
2
|
|
3 import alice.codesegment.CodeSegment;
|
|
4 import alice.datasegment.CommandType;
|
|
5 import alice.datasegment.Receiver;
|
|
6
|
|
7
|
111
|
8 public class SetLocation extends CodeSegment{
|
91
|
9
|
97
|
10 private Receiver position = ids.create(CommandType.PEEK);
|
138
|
11 private MakeObject obj;
|
178
|
12 private int range; // should be DS
|
91
|
13
|
178
|
14 public SetLocation(MakeObject obj ,String key, int index, int range){
|
127
|
15 this.obj = obj;
|
110
|
16 this.range = range;
|
105
|
17 this.position.setKey("local",key,index);
|
91
|
18 }
|
|
19
|
|
20 @Override
|
|
21 public void run(){
|
216
|
22 FishPoint fp = this.position.asClass(FishPoint.class);
|
170
|
23 obj.setLocation(fp.getX(), fp.getY(), fp.getZ());
|
214
|
24 new SetLocation(obj, position.key, position.index, range);
|
110
|
25
|
91
|
26 }
|
|
27
|
|
28
|
|
29 }
|