cage.core
Class Cage

java.lang.Object
  extended by cage.core.Cage

public class Cage
extends java.lang.Object

Cage.java is the entry point into Cage. All production loading and scene changes are handled by this class. Cage is the driver for the separate Engines within the overall application. See documentation on main method for parameters/args.

Author:
Seth Marinello

Constructor Summary
Cage()
           
 
Method Summary
static void changeScene(java.lang.String sceneName)
          Changes the scene by name lookup.
static void gameLoop(int delay)
           
static Scene getCurrentScene()
          Returns the scene currently displayed.
static org.minueto.MinuetoEventQueue getQueue()
          Returns the event queue for Cage input.
static void main(java.lang.String[] args)
          Starts CAGE running.
static void restoreState()
          Clears the currently loaded Scenes and loads a set of Scene, Carl game state values and a saved scene location into CAGE, restoring the state from a file output by saveState().
static void run(java.lang.String productionFile)
          This method sets up a production for running and displays it until interuppted or input is given.
static void saveState()
          Writes the current state of the game to an XML file.
static void setProductionAuthor(java.lang.String productionAuthor)
          Sets the production author.
static void setProductionName(java.lang.String productionName)
          Sets the production name.
static void setProductionStart(java.lang.String productionStart)
          Sets the production start.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cage

public Cage()
Method Detail

run

public static void run(java.lang.String productionFile)
This method sets up a production for running and displays it until interuppted or input is given.

Parameters:
productionFile - The production to load

setProductionName

public static void setProductionName(java.lang.String productionName)
Sets the production name.

Parameters:
productionName - The name

setProductionStart

public static void setProductionStart(java.lang.String productionStart)
Sets the production start.

Parameters:
productionStart - The start

setProductionAuthor

public static void setProductionAuthor(java.lang.String productionAuthor)
Sets the production author.

Parameters:
productionAuthor - The author

getCurrentScene

public static Scene getCurrentScene()
Returns the scene currently displayed.

Returns:
The current scene.

getQueue

public static org.minueto.MinuetoEventQueue getQueue()
Returns the event queue for Cage input.

Returns:
The event queue

changeScene

public static void changeScene(java.lang.String sceneName)
Changes the scene by name lookup. If a scene is currently loaded, it will remove the overlay of the previous scene as well.

Parameters:
sceneName - The scene name to switch to.

restoreState

public static void restoreState()
Clears the currently loaded Scenes and loads a set of Scene, Carl game state values and a saved scene location into CAGE, restoring the state from a file output by saveState().


saveState

public static void saveState()
Writes the current state of the game to an XML file.


main

public static void main(java.lang.String[] args)
Starts CAGE running. CAGE accpets 5 different args.
  1. -d or --debug : puts the logger output at debug level
  2. -i or --info : puts the logger output at info level
  3. -e or --edit : puts the mouse handler in edit mode (right click to move sprites)
  4. -g or --gui : error level messages are displayed in GUI Dialogs
  5. other string : any other strings will be treated as a path to a production file, with subsequent strings replacing the previous path.

Some notes: by default the logger is set to error only reporting. If no file path is specifed the program will assume it is being run in GUI mode and prompt for a production file via an open dialog. All errors will be reported via dialogs in this mode.
The --gui option is provided for those who wish to pass a production file but still retain the gui messages.
The operating system is also checked to see if we are running on an OS X machine. If so the applcation name is set so the menu bar will display "CAGE" rather than the classname, "cage.core.Cage".


gameLoop

public static void gameLoop(int delay)