Class GameController

java.lang.Object
  extended by java.lang.Thread
      extended by GameController
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.event.WindowListener, java.lang.Runnable, java.util.EventListener

public class GameController
extends java.lang.Thread
implements java.awt.event.KeyListener, java.awt.event.WindowListener

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static int MAX_ANGLE
           
static int MAX_VELOCITY
           
static int MIN_ANGLE
           
static int MIN_VELOCITY
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
GameController(Game game, int ticksPerSecond)
           
 
Method Summary
 int getAngle()
           
 Game getGame()
           
 int getVelocity()
           
 boolean isPaused()
           
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
 void run()
           
 void setViewer(GameGUI gui)
           
 void windowActivated(java.awt.event.WindowEvent arg0)
           
 void windowClosed(java.awt.event.WindowEvent arg0)
           
 void windowClosing(java.awt.event.WindowEvent arg0)
           
 void windowDeactivated(java.awt.event.WindowEvent arg0)
           
 void windowDeiconified(java.awt.event.WindowEvent arg0)
           
 void windowIconified(java.awt.event.WindowEvent arg0)
           
 void windowOpened(java.awt.event.WindowEvent arg0)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_VELOCITY

public static final int MIN_VELOCITY

MAX_VELOCITY

public static final int MAX_VELOCITY

MIN_ANGLE

public static final int MIN_ANGLE

MAX_ANGLE

public static final int MAX_ANGLE
Constructor Detail

GameController

public GameController(Game game,
                      int ticksPerSecond)
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

getGame

public Game getGame()

isPaused

public boolean isPaused()

getAngle

public int getAngle()

getVelocity

public int getVelocity()

setViewer

public void setViewer(GameGUI gui)

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent arg0)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent arg0)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent arg0)
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent arg0)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent arg0)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent arg0)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent arg0)
Specified by:
windowOpened in interface java.awt.event.WindowListener