package edu.wheaton.simulator.gui;

import edu.wheaton.simulator.entity.Prototype;
import edu.wheaton.simulator.simulation.GUIToAgentFacade;

public class SpawnCondition {

	public final Prototype prototype; 
	
	public final int x; 
	
	public final int y; 
	
	public final String pattern; 
	
	public final int number; 
	
	public SpawnCondition(Prototype prototype, int x, int y, int number, String pattern) { 
		this.pattern = pattern; 
		this.prototype = prototype;
		this.x = x; 
		this.y = y;
		this.number = number; 
	}
	
	public void addToGrid(GUIToAgentFacade facade) {
		if (pattern.equals("Clustered")) {
			facade.getGrid().spawnAgent(prototype.createAgent(), x, y);
		}
		else facade.getGrid().spawnAgent(prototype.createAgent());
	}
	
}

@@ -202,17 +202,16 @@
 otype; %0A
-%09
 %0A%09public
@@ -225,17 +225,16 @@
 int x; %0A
-%09
 %0A%09public
@@ -248,17 +248,16 @@
 int y; %0A
-%09
 %0A%09public
@@ -280,17 +280,16 @@
 ttern; %0A
-%09
 %0A%09public
@@ -308,17 +308,16 @@
 umber; %0A
-%09
 %0A%09public
@@ -512,17 +512,16 @@
 er; %0A%09%7D%0A
-%09
 %0A%09public
@@ -600,16 +600,55 @@
 ed%22)) %7B%0A
+%09%09%09for (int i = 0; i %3C number; i++) %7B%0A%09
 %09%09%09facad
@@ -702,16 +702,21 @@
  x, y);%0A
+%09%09%09%7D%0A
 %09%09%7D%0A%09%09el
@@ -722,65 +722,379 @@
 lse 
-facade.getGrid().spawnAgent(prototype.createAgent());
+if (pattern.equals(%22Random%22)) %7B%0A%09%09%09for (int i = 0; i %3C number; i++) %7B%0A%09%09%09%09facade.getGrid().spawnAgent(prototype.createAgent());%0A%09%09%09%7D%0A%09%09%7D%0A%09%09else if (pattern.equals(%22Horizontal%22)) %7B%0A%09%09%09for (int i = 0; i %3C number; i++) %7B%0A%09%09%09%09//Horizontal line spawn%0A%09%09%09%7D%0A%09%09%7D%0A%09%09else if (pattern.equals(%22Vertical%22)) %7B%0A%09%09%09for (int i = 0; i %3C number; i++) %7B%0A%09%09%09%09//vertical line spawn%0A%09%09%09%7D%0A%09%09%7D
 %0A%09%7D%0A
-%09
 %0A%7D%0A

fix some minor issues