view 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
line wrap: on
line source

package alice.test.topology.movement;

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


public class SendLocation extends CodeSegment{
	
	public Receiver nowX = ids.create(CommandType.TAKE);
	public Receiver nowY = ids.create(CommandType.TAKE);
	
	@Override
	public void run(){
		System.out.println("run SendLocation");
		int x = this.nowX.asInteger();
		int y = this.nowY.asInteger();
		System.out.println("setX : " +x/100);
		
		FishMovement fm = FishMovement.getInstance();
		fm.setLocation((float)x/100, (float)y/100);
		x++;
		y++;

		
		SendLocation cs = new SendLocation();
		cs.nowX.setKey("parent","fishX");
		cs.nowY.setKey("parent","fishY");
		
		ods.update("parent", "fishX", x);
		ods.update("parent", "fishY", y);
		
		
				
	}
	

}