TestScenario.java



/** BananaWorld の出来事の実験 */

package bananaworld;

public class TestScenario {

  /** 処理の開始のメソッド */
   public static void main( String argv[] ) {

       BananaTree tree = new BananaTree();
       Elephant elephant = new Elephant();
       Snake snake = new Snake();

       Banana[] bananaArray = tree.drop();
       for( int i=0; i<bananaArray.length; i++ ) {
          elephant.eat( bananaArray[i] );
       }
       snake.eat( elephant );

       System.out.println( "Snake Energy is "
                          + snake.getEnergy() );
   }
}