// Path: src/com/hotmail/kalebmarc/textfighter/player/Xp.java
// public class Xp {
// 
// 	//Variables
//     private static int xp;
//     private static int battleXp;
//     private static int xpNeeded;
//     private static int level;
// 	public static int total;
// 
//     private Xp() {
//     }
// 
//     private static void levelUp() {
//         if (level == 9) {
//             Ui.popup("You've reached level 10!\nYou have been rewarded 250 coins!", "Level Up!", JOptionPane.INFORMATION_MESSAGE);
//             level = 10;
//             Coins.set(250, true);
// 
// 		}else if(level > 100){
// 			Handle.error("Error - Level is greater than 100");
//             level = 100;
// 		}else if(level == 99){
//             level = 100;
//             xp = 49000;
//         }else {
// 
// 			Ui.popup("You've leveled up! You are now level " + (level + 1) + "!\nYou have been rewarded 100 coins!", "Level Up!", JOptionPane.INFORMATION_MESSAGE);
// 			xp = 0;
// 			xpNeeded += 500;
// 			level++;
//             Coins.set(100, true);
// 		}
// 		Achievements.check();
// 	}
// 
// 	public static void set(int amount, boolean add) {
// 
//         if((level == 100) || Cheats.enabled()){
//             return;
//         }
//         if (add){
//             xp += amount;
//             total += amount;
//         } else {
//             xp = amount;
//         }
// 		if ((xp >= xpNeeded) && (xpNeeded != 0)){// (xpNeeded != 0) is so it doesn't try and level up when cheats are enabled (Which sets xp and xpNeeded to 0)
// 			int leftOverXp = xp - xpNeeded;
//             levelUp();
//             set(leftOverXp, true);
// 		}
// 
// 	}
// 	
// 	public static int getBattleXp() {
// 		return battleXp;
// 	}
// 	
// 	public static void setBattleXp(int amount, boolean add) {
// 		if(add) {
// 			battleXp += amount;
// 		} else {
// 			battleXp = amount;
// 		}
// 	}
// 
// 	public static void setLevel(int lvl){
//         level = lvl;
// 	}
// 
// 	public static void setOutOf(int outOf){
// 		xpNeeded = outOf;
// 	}
// 	public static void setAll(int current, int outOf, int lvl){
//         xp = current;
//         xpNeeded = outOf;
//         level = lvl;
//     }
// 
//     public static int get(){
//         return xp;
//     }
// 
//     public static int getOutOf(){
//         return xpNeeded;
//     }
// 
//     public static int getLevel(){
//         return level;
//     }
// 
//     public static String getFull(){
//         return xp + "/" + xpNeeded + " xp";
//     }
// }


import static org.junit.Assert.*;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Set;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import com.hotmail.kalebmarc.textfighter.player.Xp;
        
        Enemy.encounterNew(); // Encounter a new enemy to fight
		
        ArrayList<Integer> suitableEnemies = new ArrayList<Integer>(); // Initialize a list of manually found suitable enemy indeces
        
        suitableEnemies.add(1);
        suitableEnemies.add(3);
        suitableEnemies.add(4);
        suitableEnemies.add(5);
        suitableEnemies.add(7);
		
		assertTrue(suitableEnemies.contains(Enemy.getIndex(Enemy.get()))); // Ensure that get returns a valid enemy that was encountered
        
        Xp.setLevel(15); // Set player level to find suitable enemies
		
        suitableEnemies = new ArrayList<Integer>(); // Initialize a list of manually found suitable enemy indeces
        
        suitableEnemies.add(0);
        suitableEnemies.add(2);
        suitableEnemies.add(4);
        suitableEnemies.add(6);
        suitableEnemies.add(8);
        suitableEnemies.add(9);
        
        Enemy.encounterNew(); // Encounter a new enemy to fight
		
		assertTrue(suitableEnemies.contains(Enemy.getIndex(Enemy.get()))); // Ensure that get returns a valid enemy that was encountered
		
        Enemy getTestEnemy = new Enemy("getTestEnemy", 90, 20, 50, 10, 30, 50, 50, 100, true, false);

// Path: src/com/hotmail/kalebmarc/textfighter/player/Xp.java
// public class Xp {
// 
// 	//Variables
//     private static int xp;
//     private static int battleXp;
//     private static int xpNeeded;
//     private static int level;
// 	public static int total;
// 
//     private Xp() {
//     }
// 
//     private static void levelUp() {
//         if (level == 9) {
//             Ui.popup("You've reached level 10!\nYou have been rewarded 250 coins!", "Level Up!", JOptionPane.INFORMATION_MESSAGE);
//             level = 10;
//             Coins.set(250, true);
// 
// 		}else if(level > 100){
// 			Handle.error("Error - Level is greater than 100");
//             level = 100;
// 		}else if(level == 99){
//             level = 100;
//             xp = 49000;
//         }else {
// 
// 			Ui.popup("You've leveled up! You are now level " + (level + 1) + "!\nYou have been rewarded 100 coins!", "Level Up!", JOptionPane.INFORMATION_MESSAGE);
// 			xp = 0;
// 			xpNeeded += 500;
// 			level++;
//             Coins.set(100, true);
// 		}
// 		Achievements.check();
// 	}
// 
// 	public static void set(int amount, boolean add) {
// 
//         if((level == 100) || Cheats.enabled()){
//             return;
//         }
//         if (add){
//             xp += amount;
//             total += amount;
//         } else {
//             xp = amount;
//         }
// 		if ((xp >= xpNeeded) && (xpNeeded != 0)){// (xpNeeded != 0) is so it doesn't try and level up when cheats are enabled (Which sets xp and xpNeeded to 0)
// 			int leftOverXp = xp - xpNeeded;
//             levelUp();
//             set(leftOverXp, true);
// 		}
// 
// 	}
// 	
// 	public static int getBattleXp() {
// 		return battleXp;
// 	}
// 	
// 	public static void setBattleXp(int amount, boolean add) {
// 		if(add) {
// 			battleXp += amount;
// 		} else {
// 			battleXp = amount;
// 		}
// 	}
// 
// 	public static void setLevel(int lvl){
//         level = lvl;
// 	}
// 
// 	public static void setOutOf(int outOf){
// 		xpNeeded = outOf;
// 	}
// 	public static void setAll(int current, int outOf, int lvl){
//         xp = current;
//         xpNeeded = outOf;
//         level = lvl;
//     }
// 
//     public static int get(){
//         return xp;
//     }
// 
//     public static int getOutOf(){
//         return xpNeeded;
//     }
// 
//     public static int getLevel(){
//         return level;
//     }
// 
//     public static String getFull(){
//         return xp + "/" + xpNeeded + " xp";
//     }
// }


// Path: src/com/hotmail/kalebmarc/textfighter/main/EnemyTest.java
import static org.junit.Assert.*;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Set;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import com.hotmail.kalebmarc.textfighter.player.Xp;

        
        Enemy.encounterNew(); // Encounter a new enemy to fight
		
        ArrayList<Integer> suitableEnemies = new ArrayList<Integer>(); // Initialize a list of manually found suitable enemy indeces
        
        suitableEnemies.add(1);
        suitableEnemies.add(3);
        suitableEnemies.add(4);
        suitableEnemies.add(5);
        suitableEnemies.add(7);
		
		assertTrue(suitableEnemies.contains(Enemy.getIndex(Enemy.get()))); // Ensure that get returns a valid enemy that was encountered
        
        Xp.setLevel(15); // Set player level to find suitable enemies
		
        suitableEnemies = new ArrayList<Integer>(); // Initialize a list of manually found suitable enemy indeces
        
        suitableEnemies.add(0);
        suitableEnemies.add(2);
        suitableEnemies.add(4);
        suitableEnemies.add(6);
        suitableEnemies.add(8);
        suitableEnemies.add(9);
        
        Enemy.encounterNew(); // Encounter a new enemy to fight
		
		assertTrue(suitableEnemies.contains(Enemy.getIndex(Enemy.get()))); // Ensure that get returns a valid enemy that was encountered
		
        Enemy getTestEnemy = new Enemy("getTestEnemy", 90, 20, 50, 10, 30, 50, 50, 100, true, false);

        Xp.setLevel(100); // Set player level to find suitable enemies