Mercurial > hg > Database > Alice
diff src/alice/test/topology/movement/SendLocation.java @ 97:df786bf8f036 working
add FishPoint.java and Test
author | sugi |
---|---|
date | Tue, 26 Jun 2012 16:48:09 +0900 |
parents | 6601f8854126 |
children | 993a9f194615 |
line wrap: on
line diff
--- a/src/alice/test/topology/movement/SendLocation.java Tue Jun 19 17:52:01 2012 +0900 +++ b/src/alice/test/topology/movement/SendLocation.java Tue Jun 26 16:48:09 2012 +0900 @@ -7,17 +7,21 @@ public class SendLocation extends CodeSegment { - public Receiver nowX = ids.create(CommandType.PEEK); - int num; + public Receiver position = ids.create(CommandType.PEEK); + float x; + float y; - public SendLocation(int x){ - this.num = x; + public SendLocation(float x,float y){ + this.x = x; + this.y = y; } @Override public void run() { System.out.println("update"); - ods.update("parent", "fish3X", this.nowX.asInteger()+num); + FishPoint FP = this.position.asClass(FishPoint.class); + FP.setXY(FP.getX()+this.x, FP.getY()+this.y); + ods.update("parent", "fish3X", FP); }