001 package breakout; 002 003 import java.awt.*; 004 005 /** 006 * A TransferWall indicates that Balls that strike it should 007 * leave the World for another. Used by the World in a network 008 * game as the top (NORTH) wall. 009 * 010 * @see breakout.Ball 011 * @see breakout.World 012 * 013 * @author benmv@olin.edu 014 * @version <tt>$Id: TransferWall.java,v 1.2 2004/03/26 20:39:33 gus Exp $</tt> 015 */ 016 public class TransferWall extends Wall { 017 public TransferWall(Point location, Dimension size, World w) { 018 super(location,size,w); 019 } 020 021 /** 022 * Balls that strike this are indicated to the world as leaving. 023 * 024 * @param bc BreakoutComponent that will be leaving if it's a Ball. 025 */ 026 public void hitBy(BreakoutComponent bc) { 027 super.hitBy(bc); 028 if (bc instanceof Ball) 029 this.world.ballLeft((Ball)bc); 030 } 031 } 032