view src/main/java/alice/test/topology/aquarium/SendLocation.java @ 547:e91a574b69de dispose

remove index
author Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
date Tue, 18 Aug 2015 16:15:17 +0900
parents 15eeb439830c
children
line wrap: on
line source

package alice.test.topology.aquarium;

import alice.codesegment.CodeSegment;
import alice.datasegment.CommandType;
import alice.datasegment.Receiver;


public class SendLocation extends CodeSegment {

    private Receiver position = ids.create(CommandType.PEEK);
    float x;
    float y;
    float z;

    public SendLocation(float x,float y,float z){
        this.x = x;
        this.y = y;
        this.z = z;
        position.setKey("fish", this);
    }

    @Override
    public void run() {
        FishPoint fp = this.position.asClass(FishPoint.class);
        fp.setXYZ(fp.getX()+x, fp.getY()+y, fp.getZ()+z);
        ods.update("fish", fp);

    }

}