Ejemplo n.º 1
0
 // ejecting a ball will eject the ball from the machine add it to the rack.
 public Ball ejectBall() {
   // we check not to get null reference balls while we are ejecting from machine.
   if (machine.getNoOfBalls() > 0 && rack.getNoOfBalls() < rack.getSize()) {
     Ball ejectedBall = machine.ejectBall();
     rack.addBall(ejectedBall);
     return ejectedBall;
   } // if
   else return null;
 } // ejectBall
Ejemplo n.º 2
0
 public int getRackSize() {
   return rack.getSize();
 } // getRackSize