import acm.util.*;
import acm.program.*;
import acm.graphics.*;
import acm.io.*;
import java.io.*;
import java.util.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;

// Class that defines a Pokemon.
// Class Constants: Stats, Moves, Graphics, Sound.
public class Pokemon {
	
	// Private Instance Variables
	private String name;
	private String type1;
	private String type2;
	
	// Four moves for each Pokemon
	private String move1;
	private String move2;
	private String move3;
	private String move4;
	
	// Pokemon Stats stored in array: [hp]  [Attack]  [Defense]  [SpAtt]  [SpDef]  [Speed]
	private int[] statistics = new int[6];
	
	// Random generator used to determine accuracy. 
	private RandomGenerator rgen = RandomGenerator.getInstance();
	
	/* Constructor */
	public Pokemon (String line){
		
		// Find name of Pokemon from data file
		int nameEnd = line.indexOf(" ");
		name = line.substring(0,nameEnd);
		
		// Parse the rest of the data to determine Pokemon's stats
		String data = line.substring(nameEnd+1);
		StringTokenizer tokenizer = new StringTokenizer(data);
		int count = 0;
		type1=tokenizer.nextToken();
		type2=tokenizer.nextToken();
		move1=tokenizer.nextToken();
		move2=tokenizer.nextToken();
		move3=tokenizer.nextToken();
		move4=tokenizer.nextToken();
		
		while (tokenizer.hasMoreTokens()){	
			statistics[count] = Integer.parseInt(tokenizer.nextToken());
			count++;
			if (count == 6) break;
		}
	}
	
	public String getName(){
		return name;
	}
	
	public int getHP(){
		return statistics[0];
	}
	
	public int editHP(int x, int y){
		x+=y;
		return x;
	}
	
	public int getAttack(){
		return statistics[1];
	}
	
	public int getDefense(){
		return statistics[2];
	}
	
	public int getSpAtt(){
		return statistics[3];
	}
	
	public int getSpDef(){
		return statistics[4];
	}
	
	public int getSpeed(){
		return statistics[5];
	}
	
	public String getType1(){
		return type1;
	}
	
	public String getType2(){
		return type2;
	}
	
	public String getMove1(){
		return move1;
	}
	
	public String getMove2(){
		return move2;
	}
	
	public String getMove3(){
		return move3;
	}
	
	public String getMove4(){
		return move4;
	}
	
	public String chooseMove(){
		int x = rgen.nextInt(0,3);
		if (x == 0){
			return move1;
		} else if (x == 1){
			return move2;
		} else if (x == 2){
			return move3;
		} else {
			return move4;
		}
	}
	
	public boolean isDead(){
		if(statistics[0] <= 0){
			return true;
		} else{
			return false;
		}
	}
}


@@ -1,273 +1,205 @@
-import acm.util.*;%0Aimport acm.program.*;%0Aimport acm.graphics.*;%0Aimport acm.io.*;%0Aimport java.io.*;%0Aimport java.util.*;%0Aimport java.awt.event.*;%0Aimport javax.swing.*;%0Aimport java.awt.*;%0A%0A// Class that defines a Pokemon.%0A// Class Constants: Stats, Moves, Graphics, Sound.
+/* File: Pokemon.java%0A * Author: Kevin Khieu%0A * Defines the behavior of a Pokemon in the game. Pokemon are comprised of moves, types, statistics, and a name.*/%0A %0Aimport acm.util.*;%0Aimport java.util.*;%0A
 %0Apub
@@ -1368,32 +1368,56 @@
 break;%0A%09%09%7D%0A%09%7D%0A%09%0A
+%09/* Getter Functions */%0A
 %09public String g
@@ -2107,24 +2107,133 @@
 move4;%0A%09%7D%0A%09%0A
+%09// We use a random generator to determine what move the opponent will use for his/her pokemon in battle. */%0A
 %09public Stri
@@ -2421,24 +2421,107 @@
 4;%0A%09%09%7D%0A%09%7D%0A%09%0A
+%09// Determine if a Pokemon is dead by seeing if its HP is equal to or less than 0.%0A
 %09public bool

Update Pokemon.java