package customiteratorobject;

import java.util.Comparator;

public class Footman implements Comparator<Footman> {
	private int id;
	private int atk;
	private int def;
	
	public Footman(int id, int atk, int def) {
		this.id = id;
		this.atk = atk;
		this.def = def;
	}

	// Want to sort in ascending order of ID.
	public int compare(Footman o1, Footman o2) {
		return o1.id - o2.id;
		// Think of o1 as the object to the left and o2 the one on the right
		// If it return False -> means that the two numbers DO NOT need to be changed -> o1 is smaller than o2 -> ascending order
	}
	
	public String[] getAttributes() {
		String[] r = new String[3];
		r[0] = Integer.toString(this.id);
		r[1] = Integer.toString(this.atk);
		r[2] = Integer.toString(this.def);
		return r;
	}
}
