/**
 * Driver class for CSS 162 Homework 4
 * This class exercises the methods, but does not fully test your code
 * 
 * @author Clark Olson
 */
public class HW4
{

/**
 * Main: creates a monsterHorde and outputs some information to (poorly) test your classes.
 * pre:  none
 * post: outputs the monsters in a newly created horde, including specifying
 *       which monster does the most damage, and checks whether the first two
 *       monsters are equivalent.
 */
    public static void main (String[] args) {
        final int MAX_HORDE = 20;
        MonsterHorde horde = new MonsterHorde(MAX_HORDE);
 
        horde.addMonster(new Goblin("Golfimbul", 5));
        horde.addMonster(new Orc("Azog", 6, "Moria"));
        horde.addMonster(new Orc("Boldog", 10, "Angband"));
        horde.addMonster(new Orc("Bolg", 7, "Moria"));
        horde.addMonster(new Orc("Grishnakh", 9, "Mordor"));
        horde.addMonster(new UrukHai("Lagduf", 12, "Cirith Ungol", 2));
        horde.addMonster(new UrukHai("Shagrat", 15, "Cirith Ungol", 3));
        System.out.println(horde);
        
        // Find the monster that does the most damage.
        int max = -999;
        int index = 0;
        for (int i = 0; i < horde.getSize(); i++) {
            if (horde.getMonster(i).getDamage() > max) {
                index = i;
                max = horde.getMonster(i).getDamage();
            }
        }
        System.out.println("\nThe monster that does the most damage is:");
        System.out.println(horde.getMonster(index));
        System.out.println();
        
        // Check whether the first two monsters are equivalent.
        if (horde.getMonster(0).equals(horde.getMonster(1))) {
            System.out.println("The first two monsters are the same.");
        } else {
            System.out.println("The first two monsters are not the same.");
        }
    }
}
