/*
 * Created on 30.12.2004
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package de.farafin.snEADy.world;

import de.farafin.snEADy.GameParameter;
import de.farafin.snEADy.communication.D_Vec2D;
import de.farafin.snEADy.communication.I_PlayFieldConstants;
import de.farafin.snEADy.communication.RingVector;

/**
 * @author lars, roland
 *
 * TODO what does that class do?
 * 
 */
public final class C_GLength extends C_Goody implements I_PlayFieldConstants
{
	/** the sie which should make the snake longer */
	private int length;

	/** default constructor */
	protected C_GLength()
	{
		this.faceDirection = FACE_NORTH;
		this.headPosition = new D_Vec2D(0, 0);
		this.nextUpdateTime = -1;
		this.objPositions = new RingVector();
		this.objPositions.addLast(this.headPosition.clone());
		this.ownChar = LENGTH;
		this.waitCycles = -1;
		this.length = 0;
	}
	

	protected C_GLength(D_Vec2D pos, int length, GameParameter parameter)
	{
		super((D_Vec2D)pos.clone(), FACE_NORTH, (length >= 0) ? LENGTH: SHORT, -1, parameter);
		this.nextUpdateTime = -1;
		this.length = length;
	}

	/* (non-Javadoc)
	 * @see de.farafin.GameParameter.world.C_GameObject#update(de.farafin.GameParameter.world.C_Arena)
	 */
	protected void update(C_Arena arena)
	{
	// TODO Auto-generated method stub
 
	}

	/* (non-Javadoc)
	 * @see de.farafin.GameParameter.world.C_Goody#wasEatenBy(de.farafin.GameParameter.world.C_Snake)
	 */
	protected void wasEatenBy(C_Snake snake)
	{
		snake.length += length;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString()
	{
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#clone()
	 */
	protected Object clone()
	{
		// TODO Auto-generated method stub
		return null;
	}

}
