package revert.Entities;

import java.awt.Point;

import revert.AI.EnemyAi;
import revert.MainScene.World;


public class EnemyFactory {

	Point[] spawnPoints;
	World world;
		
	public EnemyFactory(World world, Point... spawns)
	{
		this.spawnPoints = spawns;
		this.world = world;
	}
	
	/**
	 * Create a data set array
	 * @param size
	 * @return
	 */
	public int[][] createWave(int size)
	{
		int[][] wave = new int[size][];
		
		for (int i = 0; i < size; i++)
		{
			Point loc = spawnPoints[(int)(Math.random()*spawnPoints.length)];
			
			int[] n = {loc.x, loc.y, (int)(Math.random()*3)};
			
			wave[i] = n;
		}
		
		return wave;
	}
	
	public Enemy generateEnemy(int type)
	{
		Enemy e = new Enemy(world, world.getPlayer());
		EnemyAi ai = null;
		if (type == 0)
		{
			//ai = new PassiveAi();
		}
		else
		{
			System.out.println("No enemy type corresponds to value: " + type + ".  Instantiating basic enemy");
		}
		
		e.setAI(ai);
		
		return e;
	}
}

@@ -43,16 +43,46 @@
 Point;%0A%0A
+import com.kgp.util.Vector2;%0A%0A
 import r
@@ -162,21 +162,23 @@
 ory %7B%0A%0A%09
-Point
+Vector2
 %5B%5D spawn
@@ -236,21 +236,23 @@
  world, 
-Point
+Vector2
 ... spaw
@@ -497,21 +497,23 @@
 %0A%09%09%7B%0A%09%09%09
-Point
+Vector2
  loc = s
@@ -587,15 +587,25 @@
  = %7B
+(int)
 loc.x, 
+(int)
 loc.

Fix enemy factory since world is now using vector2