comparison src/alice/test/topology/movement/SendLocation.java @ 81:02dfb6c72632 working

This is movement test
author sugi
date Thu, 24 May 2012 00:20:16 +0900
parents
children 5cf20458b9e0
comparison
equal deleted inserted replaced
80:54f5b5496bfe 81:02dfb6c72632
1 package alice.test.topology.movement;
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 nowX = ids.create(CommandType.TAKE);
11 public Receiver nowY = ids.create(CommandType.TAKE);
12
13 @Override
14 public void run(){
15 System.out.println("run SendLocation");
16 int x = this.nowX.asInteger();
17 int y = this.nowY.asInteger();
18 System.out.println("setX : " +x/100);
19
20 FishMovement fm = FishMovement.getInstance();
21 fm.setLocation((float)x/100, (float)y/100);
22 x++;
23 y++;
24
25
26 SendLocation cs = new SendLocation();
27 cs.nowX.setKey("parent","fishX");
28 cs.nowY.setKey("parent","fishY");
29
30 ods.update("parent", "fishX", x);
31 ods.update("parent", "fishY", y);
32
33
34
35 }
36
37
38 }