Breakout Problem Set Javadocs

breakout
Class World

java.lang.Object
  extended bybreakout.World
All Implemented Interfaces:
java.lang.Runnable

public class World
extends java.lang.Object
implements java.lang.Runnable

World controls Breakout's clock, and manages the different phases of calculation that occur during each unit of time. Once World has been started up, a tick proceeds as follows:

  1. Call update() on the list of all BreakoutComponents obtained from Board.
  2. Call resolveBounces(Iterator it) on the list of all Rebounding components obtained from Board.
  3. Call diedWhileRebounding() on the list of all Rebounding components to clear out any that died during the rebound phase.
  4. Decide if the game meets a win/lose condition or not.
  5. Redraw the board and sleep until time for the next batch of calculations.


Field Summary
static int TICK_LENGTH
          Time to sleep at the end of each tick
 
Constructor Summary
World(Board aBoard, BreakoutUI bui)
          Creates a new World with the specified Board and BreakoutUI.
 
Method Summary
 Board getBoard()
          Gets the Board associated with this World.
 void run()
          Runs continuously while game is in progress.
 void start()
          Starts the game, and disables the autolayout "add" method in Board.
 void stop()
          Stops the game.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TICK_LENGTH

public static final int TICK_LENGTH
Time to sleep at the end of each tick

See Also:
Constant Field Values
Constructor Detail

World

public World(Board aBoard,
             BreakoutUI bui)
Creates a new World with the specified Board and BreakoutUI.

Method Detail

start

public void start()
Starts the game, and disables the autolayout "add" method in Board.


stop

public void stop()
Stops the game.


run

public void run()
Runs continuously while game is in progress.

Specified by:
run in interface java.lang.Runnable

getBoard

public Board getBoard()
Gets the Board associated with this World.


Breakout Problem Set Javadocs