/**
 * Tests a PlayerScore object in the context of a
 * short arcade game transcript.
 *
 * @author Zach Tomaszewski
 */
public class UsernameA05 {

  public static void main(String[] args) {
    String playerName = "Unlucky Pete";

    //build a new PlayerScore and test its accessor methods
    PlayerScore score = new PlayerScore(playerName);
    System.out.println("A new player starts a game.");
    System.out.println("[" + playerName + " == " + score.getName() + "]");
    System.out.println("At this point, " + score.getName() + " has no points.");
    System.out.println("[" + 0 + " == " + score.getScore() + "]");

    //test add and die methods
    System.out.println();
    System.out.println(score.getName() + " collects 3 gold coins " +
        "(3 x 20 points).");
    score.add(20);
    score.add(20);
    score.add(20);
    System.out.println("[" + 60 + " == " + score.getScore() + "]");
    System.out.println(score.getName() + " then kills an alligator " +
        "(5 points)...");
    score.add(5);
    System.out.println("[" + 65 + " == " + score.getScore() + "]");
    System.out.println("... but is killed by the next alligator.");
    score.die();
    System.out.println("[" + 15 + " == " + score.getScore() + "]");

    //test reset
    System.out.println();
    System.out.println("Frustrated by this, " + score.getName() +
       " resets the game rather than continuing.");
    score.reset();
    System.out.println("[" + playerName + " == " + score.getName() + "]");
    System.out.println("[" + 0 + " == " + score.getScore() + "]");

  }
}
