org.jrabbit.standard.intro
Class IntroLoop

java.lang.Object
  extended by org.jrabbit.base.core.loop.Loop
      extended by org.jrabbit.standard.intro.IntroLoop
All Implemented Interfaces:
Renderable, Updateable

public class IntroLoop
extends Loop

An IntroLoop contains a sequence of Intros that it plays at the beginning of a game. Using IntroLoop is fairly basic; one is already provided by StandardGame. Simply add all desired Intros to it, and the game will automatically play them if enabled. NOTE: By default, the Mouse is hidden while the IntroLoop plays. It is made visible again when the Intro finishes.

Author:
Chris Molini

Field Summary
protected  Intro current
          The current Intro being played.
protected  java.util.LinkedList<Intro> queue
          The queue of remaining Intros.
 
Fields inherited from class org.jrabbit.base.core.loop.Loop
controller, exit
 
Constructor Summary
IntroLoop()
          Creates an empty IntroLoop.
 
Method Summary
protected  void advanceIntro()
          Advances to the next Intro, destroying the current one if it is non-null.
 void end()
          Resets all necessary settings after all Intros have finished playing.
 java.util.LinkedList<Intro> queue()
          Accesses the list of Intros to play.
 void render()
          Renders the currently active Intro.
 void start()
          Calls create() on all Intros in the queue, and hides the mouse.
 void update(int delta)
          Updates the Keyboard and Mouse handlers and all currently playing Audio, and then updates or advances the current Intro (as determined by Intro.finished().
 
Methods inherited from class org.jrabbit.base.core.loop.Loop
controller, exit, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queue

protected java.util.LinkedList<Intro> queue
The queue of remaining Intros.


current

protected Intro current
The current Intro being played.

Constructor Detail

IntroLoop

public IntroLoop()
Creates an empty IntroLoop.

Method Detail

queue

public java.util.LinkedList<Intro> queue()
Accesses the list of Intros to play.

Returns:
The LinkedList of Intros in the IntroLoop.

start

public void start()
Calls create() on all Intros in the queue, and hides the mouse.

Overrides:
start in class Loop

end

public void end()
Resets all necessary settings after all Intros have finished playing.

Overrides:
end in class Loop

update

public void update(int delta)
Updates the Keyboard and Mouse handlers and all currently playing Audio, and then updates or advances the current Intro (as determined by Intro.finished().

Specified by:
update in interface Updateable
Overrides:
update in class Loop
Parameters:
delta - The number of clock ticks that have passed.

advanceIntro

protected void advanceIntro()
Advances to the next Intro, destroying the current one if it is non-null. If no Intros are left in the queue, the IntroLoop exits and the full game begins.


render

public void render()
Renders the currently active Intro.

Specified by:
render in interface Renderable
Overrides:
render in class Loop