package net.phatcode.rel;

import net.phatcode.rel.utils.LinkedArray;

public class EnemyEntityFactoryFang extends EnemyEntityFactory
{

	public EnemyEntityFactoryFang( int size )
	{
		enemies = new LinkedArray<EnemyEntity>( size, new EnemyEntityFang() );
		int s = enemies.getSize();
		for( int i = 0; i < s; i++ )
		{
			enemies.set( i, new EnemyEntityFang() );
		}
		
	}
	
	@Override
	public EnemyEntity spawn( TurretFactory turrets,
							  float startX,
					     	  float startY,
					     	  float endX,
					     	  float endY )
	{
	
		EnemyEntityFang fang = (EnemyEntityFang)enemies.getFreeElement();
		if( fang != null )
		{
			fang.spawn( turrets );
			return fang;
		}
		
		return null;
		
	}

}
