view src/alice/test/topology/aquarium/SetLocation.java @ 217:b5c642ba998e working

change as** method and remove "local" key in TEST
author sugi
date Wed, 27 Mar 2013 20:02:38 +0900
parents 21bd8af1cf26
children ba55adb8a042
line wrap: on
line source

package alice.test.topology.aquarium;

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


public class SetLocation extends CodeSegment{
	
	private Receiver position = ids.create(CommandType.PEEK);
	private MakeObject obj;
	private int range; // should be DS
	
	public SetLocation(MakeObject obj ,String key, int index, int range){
		this.obj = obj;
		this.range = range;
		this.position.setKey(key,index);
	}
	
	@Override
	public void run(){
		FishPoint fp = this.position.asClass(FishPoint.class);
		obj.setLocation(fp.getX(), fp.getY(), fp.getZ());
		new SetLocation(obj, position.key, position.index, range);
					
	}
	

}