package org.example.lottery;

import java.util.Scanner;

import org.example.lottery.actions.LotteryGenerator;
import org.example.lottery.entities.LotteryTicket;

public class LotteryAppl {

	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
		
		LotteryGenerator generator = new LotteryGenerator();
		LotteryTicket ticket = null;
		
		
//		program flow
//        
//        ask the user is they want auto-pick
		System.out.print("Do you want Auto-Pick? (true/false) ");
		boolean autoPick = in.nextBoolean();

//      if yes
//      call the Lottery generator to auto-pick a Lottery Ticket
		if (autoPick) {
			ticket = generator.autoPick();
		}

//        else
//           loop 6 times and ask for a number
//           pass the array of numbers to the Lottery generator and get back
//              a Lottery Ticket
//              
		else
		{
			int[] data = new int[6];
			for (int x = 0; x < 6; x++)
			{
				System.out.print("Please enter a Lottery number: ");
				int temp = in.nextInt();
				data[x] = temp;
			}
			ticket = new LotteryTicket();
			ticket.setNumbers(data);
			
		}
//        display the Ticket details to the User
		System.out.println(ticket);
		in.close();
	}

}
