org.jtgl.gaming
Class Sequence

java.lang.Object
  extended by org.jtgl.gaming.Sequence

public final class Sequence
extends java.lang.Object

Stores a sequence of values (such as keyFrames of a Sprite, or time-frames,etc..) and provides various "walks" such as ping-pong,reverse or random.

Author:
Manuel Polo (manuel_polo at yahoo dot es)

Field Summary
static int DEFAULT
           
static int PING_PONG
           
static int RANDOM
           
static int REVERSE
           
 
Constructor Summary
Sequence()
          Creates a new instance of Sequence
Sequence(int[] sequence)
          Creates a new instance of Sequence
Sequence(int[] sequence, int mode)
          Creates a new instance of Sequence
Sequence(int a, int b)
          Creates a new instance of Sequence
Sequence(int a, int b, int mode)
          Creates a new instance of Sequence
 
Method Summary
 int getFrame()
           
 int getMode()
           
 int[] getSequenceArray()
           
 int getSequenceLength()
           
 int nextFrame()
           
 void setExpansion(int expansion)
           
 void setFrame(int sequenceIndex)
           
 void setMode(int mode)
           
 void setSequence(int[] newSequence)
           
 void setSequence(int a, int b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final int DEFAULT
See Also:
Constant Field Values

REVERSE

public static final int REVERSE
See Also:
Constant Field Values

PING_PONG

public static final int PING_PONG
See Also:
Constant Field Values

RANDOM

public static final int RANDOM
See Also:
Constant Field Values
Constructor Detail

Sequence

public Sequence()
Creates a new instance of Sequence


Sequence

public Sequence(int[] sequence,
                int mode)
Creates a new instance of Sequence


Sequence

public Sequence(int a,
                int b,
                int mode)
Creates a new instance of Sequence


Sequence

public Sequence(int[] sequence)
Creates a new instance of Sequence


Sequence

public Sequence(int a,
                int b)
Creates a new instance of Sequence

Method Detail

setSequence

public void setSequence(int a,
                        int b)

setSequence

public void setSequence(int[] newSequence)

getSequenceArray

public int[] getSequenceArray()

getMode

public int getMode()

setMode

public void setMode(int mode)

setExpansion

public void setExpansion(int expansion)

setFrame

public void setFrame(int sequenceIndex)

getFrame

public int getFrame()

getSequenceLength

public int getSequenceLength()

nextFrame

public int nextFrame()