package scores;

public class BestPlayer2 {
	private String name;
	private int score;
	
	public BestPlayer2(String name, int score) {
		this.name = name;
		this.score = score;
	}
	
	public int compareTo(BestPlayer2 p){
		if (this.score > p.getScore()) {
			return 1;
		}
		else if (this.score == p.getScore()) {
			return 0;
		}
		else {
			return -1;
		}
	}


	public String getName() {
		return name;
	}


	public void setName(String player) {
		this.name = player;
	}
	
	public int getScore() {
		return this.score;
	}
	
	public void setScore(int score) {
		this.score = score;
	}
}

@@ -16,218 +16,959 @@
 %0D%0A%0D%0A
-public class BestPlayer2 %7B%0D%0A%09private String name;%0D%0A%09private int score;%0D%0A%09%0D%0A%09public BestPlayer2(String name, int score) %7B%0D%0A%09%09this.name = name;%0D%0A%09%09this.score = score;%0D%0A%09%7D%0D%0A%09%0D%0A%09public int compareTo(BestPlayer2 p)%7B
+/**%0D%0A * Class representing the best player%0D%0A * @author Johan Brunet, Julien Gallego%0D%0A *%0D%0A */%0D%0Apublic class BestPlayer2 implements Comparable%3CBestPlayer2%3E %7B%0D%0A%09/**%0D%0A%09 * The name of the best player%0D%0A%09 */%0D%0A%09private String name;%0D%0A%09/**%0D%0A%09 * The name of the best player%0D%0A%09 */%0D%0A%09private int score;%0D%0A%09%0D%0A%09/**%0D%0A%09 * Constructor of the class%0D%0A%09 * @param name the name of the player%0D%0A%09 * @param score the score of the player%0D%0A%09 */%0D%0A%09public BestPlayer2(String name, int score) %7B%0D%0A%09%09this.name = name;%0D%0A%09%09this.score = score;%0D%0A%09%7D%0D%0A%09%0D%0A%09/**%0D%0A%09 * Method to compare the score of the current player to another one%0D%0A%09 * @param p the player to compare to the current one%0D%0A%09 * @return -1 if the current player's score is lesser than the other's, 0 if the scores are equals, 1 in other case%0D%0A%09 */%0D%0A%09public int compareTo(BestPlayer2 p) %7B%0D%0A%09%09if (p == null) %7B%0D%0A%09%09%09throw new NullPointerException();%0D%0A%09%09%7D%0D%0A%09%09if (!(p instanceof BestPlayer2)) %7B%0D%0A%09%09%09throw new ClassCastException();%0D%0A%09%09%7D
 %0D%0A%09%09

Update BestPlayer2