Drag[en]gine Script Module DragonScript Script API  1.0
CodecPropertyString Class Reference

Provides support for encoding/decoding various data types from/to property strings. More...

Inheritance diagram for CodecPropertyString:

Public Member Functions

Color decodeColor3 (String string)
 Decode property string into a 3-component color. More...
 
Color decodeColor4 (String string)
 Decode property string into a 4-component color. More...
 
DVector decodeDVector (String string)
 Decode property string into a 3-component dvector. More...
 
Array decodeFixedFloatList (String string, int valueCount)
 Decode property string into a fixed sized list of floating point values. More...
 
Array decodeFixedIntList (String string, int valueCount)
 Decode property string into a fixed sized list of integer point values. More...
 
FloatRectArea decodeFloatRectArea (String string)
 Decode property string into a 4-component vector. More...
 
Point decodePoint (String string)
 Decode property string into a 2-component point. More...
 
RectArea decodeRectArea (String string)
 Decode property string into a rectangular area. More...
 
ShapeList decodeShapeList (String string)
 Decode property string into a shape list. More...
 
Dictionary decodeStringDictionary (String string)
 Decode property string into a dictionary of key/value strings. More...
 
Array decodeStringList (String string)
 Decode property string into a list of strings. More...
 
Vector decodeVector (String string)
 Decode property string into a 3-component vector. More...
 
Vector2 decodeVector2 (String string)
 Decode property string into a 2-component vector. More...
 
String encodeColor3 (Color color)
 Encode a 3-component color into a property string. More...
 
String encodeColor4 (Color color)
 Encode a 4-component color into a property string. More...
 
String encodeDVector (DVector vector)
 Encode a 3-component dvector into a property string. More...
 
String encodeFloatRectArea (FloatRectArea area)
 Encode a 4-component vector into a property string. More...
 
String encodePoint (Point point)
 Encode a 2-component point into a property string. More...
 
String encodeRectArea (RectArea area)
 Encode a rectangular area into a property string. More...
 
String encodeShapeList (ShapeList list)
 Encode shape list into a property string. More...
 
String encodeStringDictionary (Dictionary dict)
 Encode a string dictionary into a property string. More...
 
String encodeStringList (Array list)
 Encode a string list into a property string. More...
 
String encodeVector (Vector vector)
 Encode a 3-component vector into a property string. More...
 
String encodeVector2 (Vector2 vector)
 Encode a 2-component vector into a property string. More...
 
CodecPropertyString new ()
 Create codec. More...
 

Detailed Description

Provides support for encoding/decoding various data types from/to property strings.

Shape List Encoding

Shape list strings contain one or more shape definitions separated by whitespaces. The accepted separaters can be modified using CodecPropertyString.setTokenSeparators().

shape1 whitespaces shape2 whitespaces ... shapeN

Shape definitions contain the shape type and a list of parameters separated by colons without spaces. The separator can be modified using CodecPropertyString.setShapeParameterSeparator().

shapeType : parameter1 : parameter2 : ... parameterN

Shape parameters contain the parameter name and the parameter values separated by comma without spaces. The separator can be modified using CodecPropertyString.setShapeValueSeparator().

parameterName , value1 , value2 , ... valueN

Values are decimal or integer values. An example box shape definition would look like this:

box:position,0,0.5,0:extends,2,1,0.5

The following table show the supported shapes and parameters. The shape type and parameter name colon contains the exact string to use for the shapeType and parameterName.

Shape Type Parameter Name Values Description
sphere position x, y, z Position of center of shape
sphere radius radius Radius of sphere
box position x, y, z Position of center of box
box rotation x, y, z Rotation of box in degrees applied in the order Z-Axis then X-Axis then Y-Axis
box extends x, y, z Extends from center to box border. These are half the dimension of the box
cylinder position x, y, z Position of center of cylinder
cylinder rotation x, y, z Rotation of cylinder in degrees applied in the order Z-Axis then X-Axis then Y-Axis
cylinder height height Height of cylinder from center to the top respective bottom
cylinder radius top, bottom Radius of top and bottom cap of cylinder. Use different radi for tapered cylinders
cylinder topAxisScaling x, y Scaling of top cap of cylinder. Allows for squeezed cylinders
cylinder bottomAxisScaling x, y Scaling of bottom cap of cylinder. Allows for squeezed cylinders
capsule position x, y, z Position of center of capsule
capsule rotation x, y, z Rotation of capsule in degrees applied in the order Z-Axis then X-Axis then Y-Axis
capsule height height Height of capsule from center to the top respective bottom
capsule radius top, bottom Radius of top and bottom cap of capsule. Use different radi for tapered capsules
capsule topAxisScaling x, y Scaling of top cap of capsule. Allows for squeezed capsules
capsule bottomAxisScaling x, y Scaling of bottom cap of capsule. Allows for squeezed capsules
Author
Roland Pl├╝ss
Version
1.0

Member Function Documentation

§ decodeColor3()

Color decodeColor3 ( String  string)

Decode property string into a 3-component color.

§ decodeColor4()

Color decodeColor4 ( String  string)

Decode property string into a 4-component color.

§ decodeDVector()

DVector decodeDVector ( String  string)

Decode property string into a 3-component dvector.

§ decodeFixedFloatList()

Array decodeFixedFloatList ( String  string,
int  valueCount 
)

Decode property string into a fixed sized list of floating point values.

§ decodeFixedIntList()

Array decodeFixedIntList ( String  string,
int  valueCount 
)

Decode property string into a fixed sized list of integer point values.

§ decodeFloatRectArea()

FloatRectArea decodeFloatRectArea ( String  string)

Decode property string into a 4-component vector.

Decode property string into a 4-component dvector. Decode property string into a floating point rectangular area.

§ decodePoint()

Point decodePoint ( String  string)

Decode property string into a 2-component point.

§ decodeRectArea()

RectArea decodeRectArea ( String  string)

Decode property string into a rectangular area.

§ decodeShapeList()

ShapeList decodeShapeList ( String  string)

Decode property string into a shape list.

§ decodeStringDictionary()

Dictionary decodeStringDictionary ( String  string)

Decode property string into a dictionary of key/value strings.

Key/value pairs are separated by pTokenSeparators. Key and value are separated by pKeyValueSeparator.

§ decodeStringList()

Array decodeStringList ( String  string)

Decode property string into a list of strings.

§ decodeVector()

Vector decodeVector ( String  string)

Decode property string into a 3-component vector.

§ decodeVector2()

Vector2 decodeVector2 ( String  string)

Decode property string into a 2-component vector.

§ encodeColor3()

String encodeColor3 ( Color  color)

Encode a 3-component color into a property string.

§ encodeColor4()

String encodeColor4 ( Color  color)

Encode a 4-component color into a property string.

§ encodeDVector()

String encodeDVector ( DVector  vector)

Encode a 3-component dvector into a property string.

§ encodeFloatRectArea()

String encodeFloatRectArea ( FloatRectArea  area)

Encode a 4-component vector into a property string.

Encode a 4-component vector into a property string. Encode a floating point rectangular area into a property string.

§ encodePoint()

String encodePoint ( Point  point)

Encode a 2-component point into a property string.

§ encodeRectArea()

String encodeRectArea ( RectArea  area)

Encode a rectangular area into a property string.

§ encodeShapeList()

String encodeShapeList ( ShapeList  list)

Encode shape list into a property string.

§ encodeStringDictionary()

String encodeStringDictionary ( Dictionary  dict)

Encode a string dictionary into a property string.

§ encodeStringList()

String encodeStringList ( Array  list)

Encode a string list into a property string.

§ encodeVector()

String encodeVector ( Vector  vector)

Encode a 3-component vector into a property string.

§ encodeVector2()

String encodeVector2 ( Vector2  vector)

Encode a 2-component vector into a property string.

§ new()

Create codec.


The documentation for this class was generated from the following file: