345
|
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 SetLocation extends CodeSegment{
|
|
9
|
|
10 private Receiver position = ids.create(CommandType.PEEK);
|
|
11 private MakeObject obj;
|
|
12
|
|
13 public SetLocation(MakeObject obj ,String key, int index){
|
|
14 this.obj = obj;
|
|
15 this.position.setKey(key,index);
|
|
16 }
|
|
17
|
|
18 @Override
|
|
19 public void run(){
|
|
20 FishPoint fp = this.position.asClass(FishPoint.class);
|
|
21 obj.setLocation(fp.getX(), fp.getY(), fp.getZ());
|
|
22 new SetLocation(obj, position.key, position.index);
|
|
23
|
|
24 }
|
|
25
|
|
26
|
|
27 }
|