com.b3dgs.lionengine.game
Class DefaultInstruction

java.lang.Object
  extended by com.b3dgs.lionengine.game.DefaultInstruction

public class DefaultInstruction
extends java.lang.Object

Allow to decode informations from a file, in order to fill some player data.

See Also:
Configurable

Constructor Summary
DefaultInstruction()
          Create a new instruction decoder.
 
Method Summary
 Animation decodeAnim(java.lang.String line)
          Get the animation instruction, delimited by {start-end} (speed) <reverse> |repeat|
 boolean decodeBool(java.lang.String line)
          Get the boolean instruction, delimited by [true]
 CollisionType decodeColl(java.lang.String line)
          Get the collision instruction, delimited by {pattern|start-end}
 CollisionArea decodeCollArea(java.lang.String line)
          Get the collision area instruction, delimited by [width*height,x;y]
 float decodeFloat(java.lang.String line)
          Get the float instruction value, delimited by (1.5)
 Range decodeRange(java.lang.String line)
          Get the collision instruction, delimited by {pattern|start-end}
 SkillData decodeSkill(java.lang.String line)
          Get skill data description, delimited by "name" <desc> (icon)
 java.lang.String decodeStr(java.lang.String line)
          Get the string instruction, delimited by "ABCDEF"
 java.lang.String getName(java.lang.String line)
          Get the instruction name, delimited by #NAME#
 java.lang.String getType(java.lang.String line)
          Get the instruction type, delimited by =TYPE=
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultInstruction

public DefaultInstruction()
Create a new instruction decoder.

Method Detail

getType

public java.lang.String getType(java.lang.String line)
Get the instruction type, delimited by =TYPE=

Parameters:
line - current line to check.
Returns:
instruction type.

getName

public java.lang.String getName(java.lang.String line)
Get the instruction name, delimited by #NAME#

Parameters:
line - current line to check.
Returns:
instruction name.

decodeStr

public java.lang.String decodeStr(java.lang.String line)
Get the string instruction, delimited by "ABCDEF"

Parameters:
line - current line to check.
Returns:
string value.

decodeBool

public boolean decodeBool(java.lang.String line)
Get the boolean instruction, delimited by [true]

Parameters:
line - current line to check.
Returns:
boolean value.

decodeFloat

public float decodeFloat(java.lang.String line)
Get the float instruction value, delimited by (1.5)

Parameters:
line - current line to check.
Returns:
float (or integer) value.

decodeAnim

public Animation decodeAnim(java.lang.String line)
Get the animation instruction, delimited by {start-end} (speed) <reverse> |repeat|

Parameters:
line - current line to check.
Returns:
animation structure.

decodeColl

public CollisionType decodeColl(java.lang.String line)
Get the collision instruction, delimited by {pattern|start-end}

Parameters:
line - current line to check.
Returns:
collision structure.

decodeCollArea

public CollisionArea decodeCollArea(java.lang.String line)
Get the collision area instruction, delimited by [width*height,x;y]

Parameters:
line - current line to check.
Returns:
collision area structure.

decodeRange

public Range decodeRange(java.lang.String line)
Get the collision instruction, delimited by {pattern|start-end}

Parameters:
line - current line to check.
Returns:
collision structure.

decodeSkill

public SkillData decodeSkill(java.lang.String line)
Get skill data description, delimited by "name" <desc> (icon)

Parameters:
line - current line to check.
Returns:
skill data structure.