001 // World.java 002 // Created: Thursday, September 23, 1999 12:20:41 PM 003 004 package ballworld; 005 006 /** 007 * The World interface describes information that a Ball can get about the World 008 */ 009 010 public interface World 011 { 012 /** Get minimum visible X value of the world. 013 * @return The minimum x coordinate 014 */ 015 public double getMinX(); 016 017 /** return the minimum visible Y value of the world 018 * @return The minimum y coordinate 019 */ 020 public double getMinY(); 021 022 /** return the maximum visible X value of the world 023 * @return The maximum x coordinate 024 */ 025 public double getMaxX(); 026 027 /** return the maximum visible Y value of the world 028 * @return The maximum y coordinate 029 */ 030 public double getMaxY(); 031 032 /** returns the Ball object that is closest to myBall 033 * (not including myBall). 034 * Be careful! If there is only one ball on the screen, 035 * then this method will return null 036 * @param myBall The ball to find neighbors for 037 * @return The nearest ball if there is one, <code>null</code> otherwise 038 */ 039 public Ball getClosestBall(Ball myBall); 040 041 /** Add a ball to the world 042 * @param aNewBall The ball to add 043 */ 044 public void addBall(Ball aNewBall); 045 046 /** Remove a ball from the world 047 * @param toBeRemoved The ball to remove 048 */ 049 public void removeBall(Ball toBeRemoved); 050 }