import javabook.*;

/**
 * This class is the top-level controller object for managing
 * all other objects in the EggyPeggy program.
 *
 * @author Dr. Caffeine
 *
 */
class EggyPeggy                // Step1: Skeleton
{

//--------------------------------
//    Data Members
//--------------------------------

    private MainWindow        mainWindow;
    private InputBox          inputBox;
    private OutputBox         outputBox; 
    private ResponseBox       responseBox;

//--------------------------------
//    Constructors
//--------------------------------

    /**
     * Default constructor. 
     * The default window title is "Let’s Play EggyPeggy".
     */
    public EggyPeggy( )
    {
        mainWindow     = new MainWindow  ("Let’s Play EggyPeggy");
        outputBox      = new OutputBox   ( mainWindow );
        responseBox    = new ResponseBox ( mainWindow );
        inputBox       = new InputBox    ( mainWindow );
    
        mainWindow.show();
        outputBox.show();
    }        


//-------------------------------------------------
//        Public Methods:
// 
//            void        start        (        )
//
//------------------------------------------------

    /**
     * Top-level method that calls other private methods
      * to play the Eggy-Peggy games.     
     */
    public void start ( )
    {
        int answer;
        
        describeGame();

        answer = responseBox.prompt("Do you want to play Eggy-Peggy?");

        while ( answer == ResponseBox.YES ) {

            getInput( );
            generateEggyPeggy( );                            
            displayResult( );                            

            answer 
            = responseBox.prompt("Do you want to play another Eggy-Peggy?");
        }
    }

//-------------------------------------------------
//        Private Methods:
// 
//        void     describeGame        (            )
//        void     displayResult       (            )
//        void     generateEggyPeggy   (            )
//        void     getInput            (            )
//
//------------------------------------------------
    
    /**
     * Provides a brief explanation of the program to the user.     
     *
     */    
    private void describeGame( )
    {
        outputBox.printLine("Inside describeGame");      //TEMP                                                      //TEMP
    }


    /**
     * Show the input string and the eggy-peggy string generated
     * from the input string.
     *     
     */
    private void displayResult( )
    {
        outputBox.printLine("Inside displayResult");    //TEMP                                                        //TEMP
    }
    

    /**
     * Generate a new string from the input string by putting the 
     * word "egg" in front of all vowels in the input string. 
     *
     */    
    private void generateEggyPeggy( )
    {
        outputBox.printLine("Inside generateEggyPeggy");     //TEMP                                                       //TEMP
    }


    /**
     * Read in the input string using InputBox.
     *
     */
    private void getInput( )
    {
        outputBox.printLine("Inside getInput");      //TEMP                                                      //TEMP
    }    

}