Mercurial > hg > Members > tatsuki > Alice
comparison src/alice/test/topology/fishmodel/alpha/SendLocation.java @ 107:a8f77957a477 working
create new model to share fish point
author | sugi |
---|---|
date | Tue, 10 Jul 2012 02:30:25 +0900 |
parents | src/alice/test/topology/movement/SendLocation.java@993a9f194615 |
children | 9845b74063ec |
comparison
equal
deleted
inserted
replaced
106:c84a2b4a877a | 107:a8f77957a477 |
---|---|
1 package alice.test.topology.fishmodel.alpha; | |
2 | |
3 import alice.codesegment.CodeSegment; | |
4 import alice.datasegment.CommandType; | |
5 import alice.datasegment.Receiver; | |
6 | |
7 | |
8 public class SendLocation extends CodeSegment { | |
9 | |
10 public Receiver position = ids.create(CommandType.PEEK); | |
11 float x; | |
12 float y; | |
13 | |
14 public SendLocation(float x,float y){ | |
15 this.x = x; | |
16 this.y = y; | |
17 } | |
18 | |
19 @Override | |
20 public void run() { | |
21 FishPoint FP = this.position.asClass(FishPoint.class); | |
22 FP.setXY(FP.getX()+this.x, FP.getY()+this.y); | |
23 ods.update("local", "fish", FP); | |
24 | |
25 } | |
26 | |
27 } |