Mercurial > hg > Database > Alice
view src/main/java/alice/test/topology/aquarium/SendLocation.java @ 543:f3f7e256ee03 dispose
add AliceDaemon on paramater
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 03 Aug 2015 20:00:53 +0900 |
parents | aefbe41fcf12 |
children | 15eeb439830c |
line wrap: on
line source
package alice.test.topology.aquarium; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; public class SendLocation extends CodeSegment { private Receiver position = ids.create(CommandType.PEEK); float x; float y; float z; public SendLocation(float x,float y,float z){ this.x = x; this.y = y; this.z = z; position.setKey("fish"); } @Override public void run() { FishPoint fp = this.position.asClass(FishPoint.class); fp.setXYZ(fp.getX()+x, fp.getY()+y, fp.getZ()+z); ods.update("fish", fp); } }