// Aaron Tan
// BallV2Driver.java
//   To test out BallV2 class

import java.util.*;
import java.awt.*;

public class BallV2Driver {

   public static void main(String[] args) {

      Scanner stdIn = new Scanner(System.in);

      BallV2 myBall1 = readBall(stdIn, "1st");
      System.out.println();
      BallV2 myBall2 = readBall(stdIn, "2nd");

      // Check if myBall1 and myBall2 contain the same data
      System.out.println();
      if ( myBall1.equals(myBall2) )
         System.out.println("They are equal.");
      else
         System.out.println("They are not equal.");

      System.out.println("1st ball: " + myBall1);
      System.out.println("2nd ball: " + myBall2);
   }

   /**************************************************
    * This method reads data from user and 
    * creates a Ball object with the read data
    **************************************************/
   public static BallV2 readBall(Scanner sc, String prompt) {
      
      System.out.print("Enter " + prompt + " ball's colour: ");
      String colour = sc.next();

      System.out.print("Enter " + prompt + " ball's radius: ");
      double radius = sc.nextDouble();

      System.out.print("Enter " + prompt + " ball's centre: ");
      int x = sc.nextInt();
      int y = sc.nextInt();

      return new BallV2(colour, radius, new Point(x,y));
   }

}

