edu.gatech.cs2335.lemmings.engine
Class AbstractGameState

java.lang.Object
  extended byedu.gatech.cs2335.lemmings.engine.AbstractGameState
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener
Direct Known Subclasses:
CreditsState, EstablishingConnectionState, GamePlayState, HelpState, LevelResultsState, LevelSelectionState, LoadLevelState, MainMenuState, MultiplayerSetupState, NetworkErrorState, SplashScreenState

public abstract class AbstractGameState
extends java.lang.Object
implements java.awt.event.ActionListener

This is the parent of all the game state classes. A game state is basically one screen - be it the splash screen, the main menu, or the game screen itself.

Author:
Vladimir Urazov

Constructor Summary
protected AbstractGameState()
          Creates a new AbstractGameState instance.
 
Method Summary
abstract  boolean cleanUp()
          This method will perform all of the necessary clean up operations once the object is no longer needed.
 LRootPane getUI()
          Returns the root pane with the UI associated with this state.
abstract  boolean initialize()
          This method will initialize the state that it belongs to.
protected  void setUI(LRootPane pane)
          Sets a new value of the root pane.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Constructor Detail

AbstractGameState

protected AbstractGameState()
Creates a new AbstractGameState instance.

Method Detail

getUI

public final LRootPane getUI()
Returns the root pane with the UI associated with this state.

Returns:
a LRootPane value

setUI

protected final void setUI(LRootPane pane)
Sets a new value of the root pane.

Parameters:
pane - a LRootPane value

initialize

public abstract boolean initialize()
This method will initialize the state that it belongs to. It will then return true upon success, and false upon failure.

Returns:
True if the initialization was successful, and false if it was not.

cleanUp

public abstract boolean cleanUp()
This method will perform all of the necessary clean up operations once the object is no longer needed.

Returns:
True if the clean-up was successful, and false if it failed.