Mercurial > hg > Members > tatsuki > Alice
changeset 145:5f37b57ff32d working
add fish number
author | sugi |
---|---|
date | Fri, 21 Sep 2012 18:32:13 +0900 |
parents | e58794b067f5 |
children | 36dc63d1bdcf |
files | .classpath src/alice/test/topology/aquarium/CheckMyName.java |
diffstat | 2 files changed, 25 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/.classpath Fri Sep 21 10:33:05 2012 +0900 +++ b/.classpath Fri Sep 21 18:32:13 2012 +0900 @@ -6,7 +6,7 @@ <classpathentry kind="lib" path="lib/slf4j-api-1.6.1.jar"/> <classpathentry kind="lib" path="lib/slf4j-log4j12-1.6.1.jar"/> <classpathentry kind="lib" path="lib/com.alexmerz.graphviz.jar"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> - <classpathentry kind="lib" path="lib/msgpack-0.6.6-201206.jar"/> + <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry exported="true" kind="lib" path="lib/msgpack-0.6.6-201206.jar"/> <classpathentry kind="output" path="bin"/> </classpath>
--- a/src/alice/test/topology/aquarium/CheckMyName.java Fri Sep 21 10:33:05 2012 +0900 +++ b/src/alice/test/topology/aquarium/CheckMyName.java Fri Sep 21 18:32:13 2012 +0900 @@ -56,23 +56,40 @@ ods.update("local", key, new FishPoint(-0.1f,-0.1f)); new SetLocation(new MakeObject(frame), key, 0, num); new CheckLocalIndex(key,1); - - for (int i = 0;i < 3 ; i++){ + for (int i = 0; i < 3 ; i++){ key = "fish"+i; if (num == 0) new AutoIncrement(key,0); - ods.update("local", key, new FishPoint(0.2f*i, 0.2f*i, 0.2f*i)); + ods.update("local", key, new FishPoint((float)Math.random(), + (float)Math.random(), (float)Math.random())); + new SetLocation(new MakeObject(frame), key, 0, num); + new CheckLocalIndex(key,1); + } + + for (int i = 3; i < 6 ; i++){ + key = "fish"+i; + if (num == 0) new AutoIncrement(key,0); + ods.update("local", key, new FishPoint(-(float)Math.random(), + -(float)Math.random(), -(float)Math.random())); new SetLocation(new MakeObject(frame), key, 0, num); new CheckLocalIndex(key,1); } - for (int i = 3;i < 6 ; i++){ + for (int i = 6; i < 9 ; i++){ key = "fish"+i; if (num == 0) new AutoIncrement(key,0); - ods.update("local", key, new FishPoint(-0.2f*i, -0.2f*i, -0.2f*i)); + ods.update("local", key, new FishPoint(-(float)Math.random(), + (float)Math.random(), -(float)Math.random())); new SetLocation(new MakeObject(frame), key, 0, num); new CheckLocalIndex(key,1); } - + for (int i = 9; i < 12 ; i++){ + key = "fish"+i; + if (num == 0) new AutoIncrement(key,0); + ods.update("local", key, new FishPoint(-(float)Math.random(), + -(float)Math.random(), (float)Math.random())); + new SetLocation(new MakeObject(frame), key, 0, num); + new CheckLocalIndex(key,1); + } } }