// Path: src/main/java/xilef11/mc/runesofwizardry_classics/items/DustVariable.java
// public class DustVariable extends DustPlaceholder {
// 	public static DustVariable instance;
// 	/**
// 	 */
// 	public DustVariable() {
// 		super("variable", 0xb92db1, true);
// 	}
// 	/* (non-Javadoc)
// 	 * @see com.zpig333.runesofwizardry.api.IDust#dustsMatch(net.minecraft.item.ItemStack, net.minecraft.item.ItemStack)
// 	 */
// 	@Override
// 	public boolean dustsMatch(ItemStack thisDust, ItemStack other) {
// 		return other.getItem() == ClassicDusts.instance;
// 	}
// }
// 
// Path: src/main/java/xilef11/mc/runesofwizardry_classics/utils/Utils.java
// public static class Coords{
// 	public final int row,col;
// 	public Coords(int r, int c) {
// 		this.row = r;
// 		this.col = c;
// 	}
// 	/* (non-Javadoc)
// 	 * @see java.lang.Object#hashCode()
// 	 */
// 	@Override
// 	public int hashCode() {
// 		return row+col;//not the best, but should be sufficient
// 	}
// 	/* (non-Javadoc)
// 	 * @see java.lang.Object#equals(java.lang.Object)
// 	 */
// 	@Override
// 	public boolean equals(Object obj) {
// 		if(obj==this)return true;
// 		if(!(obj instanceof Coords))return false;
// 		Coords o = (Coords)obj;
// 		return this.row==o.row && this.col==o.col;
// 	}
// }


import java.util.HashSet;
import java.util.Set;
import net.minecraft.item.ItemStack;
import xilef11.mc.runesofwizardry_classics.items.DustVariable;
import xilef11.mc.runesofwizardry_classics.utils.Utils.Coords;
package xilef11.mc.runesofwizardry_classics.runes;

/**
 * Handles Runes with variable dust that must match
 * @author Xilef11
 *
 */
//FUTURE This would be better as an interface (for RuneEntity) with default values, because we wouldn't need to expose patternMatches in IRune. however, we don't want to be Java 8 only.
public abstract class VariableRune extends ClassicRune {
	private Set<Coords> variables=null;
	/**
	 * Returns all variable dust positions in this rune.
	 * Not a super efficient default implementation, subclasses should override if they know the variable positions at compile time
	 */
	public Set<Coords> getVariableDusts(){
		if(variables==null){
			variables=new HashSet<>();
			ItemStack[][] pattern = getPattern();
			for(int r = 0;r<pattern.length;r++){
				for(int c=0;c<pattern[r].length;c++){
					ItemStack s = pattern[r][c];
// Path: src/main/java/xilef11/mc/runesofwizardry_classics/items/DustVariable.java
// public class DustVariable extends DustPlaceholder {
// 	public static DustVariable instance;
// 	/**
// 	 */
// 	public DustVariable() {
// 		super("variable", 0xb92db1, true);
// 	}
// 	/* (non-Javadoc)
// 	 * @see com.zpig333.runesofwizardry.api.IDust#dustsMatch(net.minecraft.item.ItemStack, net.minecraft.item.ItemStack)
// 	 */
// 	@Override
// 	public boolean dustsMatch(ItemStack thisDust, ItemStack other) {
// 		return other.getItem() == ClassicDusts.instance;
// 	}
// }
// 
// Path: src/main/java/xilef11/mc/runesofwizardry_classics/utils/Utils.java
// public static class Coords{
// 	public final int row,col;
// 	public Coords(int r, int c) {
// 		this.row = r;
// 		this.col = c;
// 	}
// 	/* (non-Javadoc)
// 	 * @see java.lang.Object#hashCode()
// 	 */
// 	@Override
// 	public int hashCode() {
// 		return row+col;//not the best, but should be sufficient
// 	}
// 	/* (non-Javadoc)
// 	 * @see java.lang.Object#equals(java.lang.Object)
// 	 */
// 	@Override
// 	public boolean equals(Object obj) {
// 		if(obj==this)return true;
// 		if(!(obj instanceof Coords))return false;
// 		Coords o = (Coords)obj;
// 		return this.row==o.row && this.col==o.col;
// 	}
// }


// Path: src/main/java/xilef11/mc/runesofwizardry_classics/runes/VariableRune.java
import java.util.HashSet;
import java.util.Set;
import net.minecraft.item.ItemStack;
import xilef11.mc.runesofwizardry_classics.items.DustVariable;
import xilef11.mc.runesofwizardry_classics.utils.Utils.Coords;

package xilef11.mc.runesofwizardry_classics.runes;

/**
 * Handles Runes with variable dust that must match
 * @author Xilef11
 *
 */
//FUTURE This would be better as an interface (for RuneEntity) with default values, because we wouldn't need to expose patternMatches in IRune. however, we don't want to be Java 8 only.
public abstract class VariableRune extends ClassicRune {
	private Set<Coords> variables=null;
	/**
	 * Returns all variable dust positions in this rune.
	 * Not a super efficient default implementation, subclasses should override if they know the variable positions at compile time
	 */
	public Set<Coords> getVariableDusts(){
		if(variables==null){
			variables=new HashSet<>();
			ItemStack[][] pattern = getPattern();
			for(int r = 0;r<pattern.length;r++){
				for(int c=0;c<pattern[r].length;c++){
					ItemStack s = pattern[r][c];
					if(s.getItem()==DustVariable.instance){