annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
92
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
1 package alice.test.topology.movement;
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
2
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
3 import alice.codesegment.CodeSegment;
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
4 import alice.datasegment.CommandType;
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
5 import alice.datasegment.Receiver;
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
6
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
7
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
8 public class SendLocation extends CodeSegment {
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
9
97
df786bf8f036 add FishPoint.java and Test
sugi
parents: 93
diff changeset
10 public Receiver position = ids.create(CommandType.PEEK);
df786bf8f036 add FishPoint.java and Test
sugi
parents: 93
diff changeset
11 float x;
df786bf8f036 add FishPoint.java and Test
sugi
parents: 93
diff changeset
12 float y;
92
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
13
97
df786bf8f036 add FishPoint.java and Test
sugi
parents: 93
diff changeset
14 public SendLocation(float x,float y){
df786bf8f036 add FishPoint.java and Test
sugi
parents: 93
diff changeset
15 this.x = x;
df786bf8f036 add FishPoint.java and Test
sugi
parents: 93
diff changeset
16 this.y = y;
92
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
17 }
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
18
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
19 @Override
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
20 public void run() {
93
6601f8854126 can KeyInputCodeSegment
sugi
parents: 92
diff changeset
21 System.out.println("update");
97
df786bf8f036 add FishPoint.java and Test
sugi
parents: 93
diff changeset
22 FishPoint FP = this.position.asClass(FishPoint.class);
df786bf8f036 add FishPoint.java and Test
sugi
parents: 93
diff changeset
23 FP.setXY(FP.getX()+this.x, FP.getY()+this.y);
df786bf8f036 add FishPoint.java and Test
sugi
parents: 93
diff changeset
24 ods.update("parent", "fish3X", FP);
92
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
25
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
26 }
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
27
8e3c1217aad4 add KeyInput
sugi
parents:
diff changeset
28 }