Mercurial > hg > Database > Alice
view src/alice/test/topology/aquarium/SetLocation.java @ 143:0651fb36a369 working
demo for Open Source Conference
author | sugi |
---|---|
date | Thu, 20 Sep 2012 22:44:11 +0900 |
parents | b51d3bf971e7 |
children | 6a69891b7232 |
line wrap: on
line source
package alice.test.topology.aquarium; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; public class SetLocation extends CodeSegment{ private Receiver position = ids.create(CommandType.PEEK); private MakeObject obj; private String key; int range; public SetLocation(MakeObject obj ,String key,int index,int range){ this.obj = obj; this.key = key; this.range = range; this.position.setKey("local",key,index); } @Override public void run(){ FishPoint fp = this.position.asClass(FishPoint.class); obj.setLocation(fp.getX() - 2*range, fp.getY(), fp.getZ()); new SetLocation(this.obj, this.key, this.position.index, this.range); } }