/******************************* MAIN HEADER **********************************
 Title:            CS302 Cafe
 Files:            CS302Cafe.java
           
 Author:           Nathan C. Burnett ncb@cs.wisc.edu
 Collaborators:    none

 Due Date:         2/2/01
 Completion Date:  2/1/01

 Course:           CS 302, Spring 2001, All Sections
 TA:               

 Compiler:         CodeWarrior IDE 4.0 (JDK 1.2)
 Platform:         Solaris/x86 2.6
**************************** 80 columns wide *********************************/

class CS302Cafe {
 

    /* The code given in the exercise.  This creates an instance of 
       the Cafe class, an instance of the Chef class and calls the 
       addChef method of the Cafe object mud.

       This represents the Chef entering the Cafe
    */

    Cafe mud = new Cafe("Mudslinger");
    Chef tel = new Chef("William Tel");
    mud.addChef(tel);

    /* Create an instance of the waiter class.
       
       The Waiter enters the Cafe.
    */

    Waiter gast = new Waiter("Gaston");
    mud.addWaiter(gast);
    
    /* Create an instance of the Patron class

       The Patron enters the Cafe

    */


    Patron fran = new Patron("Francois");
    mud.addPatron(fran);

    /* The patron gives his/her order to the waiter */

    fran.giveOrder(gast);

    /* The waiter delivers the order to the chef */

    gast.giveOrder(tel);
    
    /* The chef prepares the food */

    Ingredient snails = new Ingredient("Escargot");

    /* Note that there are two versions of this exercise in circulation.
       in one version tel.makeFood(snails) is correct, and in the other,
       the following is correct.  */
    tel.addFood(snails);

    /* The chefs gives the food to the waiter */

    tel.giveFood(gast);

    /* The waiter gives the food to the patron */

    gast.giveFood(fran);

    /* The patron eats, pays and leaves */

    fran.eat();
    fran.pay(gast);
    mud.removePatron();
}

