|
Drag[en]gine Script Module DragonScript 1.35
|
Provides support for encoding/decoding various data types from/to property strings. More...
Public Member Functions | |
| CollisionFilter | decodeCollisionFilter (String value, Dictionary filterBitMap) |
| Decode CollisionFilter using filter bit names. | |
| Color | decodeColor3 (String string) |
| Decode property string into a 3-component color. | |
| Color | decodeColor4 (String string) |
| Decode property string into a 4-component color. | |
| DVector | decodeDVector (String string) |
| Decode property string into a 3-component dvector. | |
| Array | decodeFixedIntList (String string, int valueCount) |
| Decode property string into a fixed sized list of integer point values. | |
| Array | decodeFloatList (String string) |
| Decode property string into a list of floating point values. | |
| FloatRectArea | decodeFloatRectArea (String string) |
| Decode property string into a 4-component vector. | |
| LayerMask | decodeLayerMask (String value) |
| Decode LayerMask. | |
| Point | decodePoint (String string) |
| Decode property string into a 2-component point. | |
| RectArea | decodeRectArea (String string) |
| Decode property string into a rectangular area. | |
| ShapeList | decodeShapeList (String string) |
| Decode property string into a shape list. | |
| Dictionary | decodeStringDictionary (String string) |
| Decode property string into a dictionary of key/value strings. | |
| Array | decodeStringList (String string) |
| Decode property string into a list of strings. | |
| Vector2 | decodeVector2 (String string) |
| Decode property string into a 2-component vector. | |
| String | encodeCollisionFilter (CollisionFilter collisionFilter, Dictionary filterBitMap) |
| Encode CollisionFilter using filter bit map. | |
| String | encodeColor3 (Color color) |
| Encode a 3-component color into a property string. | |
| String | encodeColor4 (Color color) |
| Encode a 4-component color into a property string. | |
| String | encodeDVector (DVector vector) |
| Encode a 3-component dvector into a property string. | |
| String | encodeFloatRectArea (FloatRectArea area) |
| Encode a 4-component vector into a property string. | |
| String | encodeLayerMask (LayerMask mask) |
| Encode LayerMask. | |
| String | encodeLayerMask (LayerMask mask, Dictionary layerMap) |
| Encode LayerMask using layer bit map. | |
| String | encodePoint (Point point) |
| Encode a 2-component point into a property string. | |
| String | encodeRectArea (RectArea area) |
| Encode a rectangular area into a property string. | |
| String | encodeShapeList (ShapeList list) |
| Encode shape list into a property string. | |
| String | encodeStringDictionary (Dictionary dict) |
| Encode a string dictionary into a property string. | |
| String | encodeStringList (Array list) |
| Encode a string list into a property string. | |
| String | encodeVector2 (Vector2 vector) |
| Encode a 2-component vector into a property string. | |
| byte | getEncodeTokenSeparator () |
| Character to separate tokens with for encoding. | |
| byte | getKeyValueSeparator () |
| Separator for key and value in dictionaries. | |
| byte | getShapeParameterSeparator () |
| Shape parameter separator character. | |
| byte | getShapeValueSeparator () |
| Shape value separator character. | |
| String | getTokenSeparators () |
| Basic separators for tokens in property strings containing multiple values. | |
| bool | isFalse (String value) |
| Value does not equal "true", "yes" or "1". | |
| bool | isTrue (String value) |
| Value equals "true", "yes" or "1". | |
| CodecPropertyString | new () |
| Create codec. | |
| void | setEncodeTokenSeparator (byte separator) |
| Set character to separate tokens with for encoding. | |
| void | setKeyValueSeparator (byte separator) |
| Set separator for key and value in dictionaries. | |
| void | setShapeParameterSeparator (byte separator) |
| Set shape parameter separator character. | |
| void | setShapeValueSeparator (byte separator) |
| Set shape value separator character. | |
| void | setTokenSeparators (String separators) |
| Set basic separators for tokens in property strings containing multiple values. | |
Public Attributes | |
| byte | pEncodeTokenSeparator |
| Character to separate tokens with for encoding. | |
| byte | pKeyValueSeparator |
| Separator for key and value in dictionaries. | |
| byte | pShapeParameterSeparator |
| Shape parameter separator character. | |
| byte | pShapeValueSeparator |
| Shape value separator character. | |
| String | pTokenSeparators |
| Basic separators for tokens in property strings containing multiple values. | |
Static Public Attributes | |
| static final Array | pTrueValues = Array.newWith("true", "yes", "1") |
Provides support for encoding/decoding various data types from/to property strings.
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 | rotation | x, y, z | Rotation of sphere in degrees applied in the order Z-Axis then X-Axis then Y-Axis |
| sphere | radius | radius | Radius of sphere |
| sphere | axisScaling | x, y | Axis scaling of sphere to create ellipsoid |
| 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 |
| box | tapering | x, y | Tapering of box scaling the top side. |
| 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 |
| hull | position | x, y, z | Position of center of hull |
| hull | rotation | x, y, z | Rotation of hull in degrees applied in the order Z-Axis then X-Axis then Y-Axis |
| hull | points | x1, y1, z1, ..., xN, yN, zN | Hull points |
| CollisionFilter Dragengine.Utils.CodecPropertyString.decodeCollisionFilter | ( | String | value, |
| Dictionary | filterBitMap ) |
Decode CollisionFilter using filter bit names.
Value is encoded either as "category:filter", "category" or empty string.
Empty string creates collision filter with empty category and full filter.
Second form is the same as first form with filter equal to category.
Category and filter decode the same way as #decodeLayerMask(String,Dictionary).
References pTokenSeparators.
Referenced by encodeCollisionFilter().
| Color Dragengine.Utils.CodecPropertyString.decodeColor3 | ( | String | string | ) |
Decode property string into a 3-component color.
Referenced by encodeCollisionFilter().
| Color Dragengine.Utils.CodecPropertyString.decodeColor4 | ( | String | string | ) |
Decode property string into a 4-component color.
Accepts also 3-component color in which case alpha is 1.
Referenced by encodeCollisionFilter().
| DVector Dragengine.Utils.CodecPropertyString.decodeDVector | ( | String | string | ) |
Decode property string into a 3-component dvector.
References pTrueValues.
Referenced by encodeCollisionFilter().
| Array Dragengine.Utils.CodecPropertyString.decodeFixedIntList | ( | String | string, |
| int | valueCount ) |
Decode property string into a fixed sized list of integer point values.
References setEncodeTokenSeparator().
Referenced by decodeShapeList(), and encodeCollisionFilter().
| Array Dragengine.Utils.CodecPropertyString.decodeFloatList | ( | String | string | ) |
Decode property string into a list of floating point values.
Referenced by decodeVector2().
| FloatRectArea Dragengine.Utils.CodecPropertyString.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.
Referenced by encodeCollisionFilter().
| LayerMask Dragengine.Utils.CodecPropertyString.decodeLayerMask | ( | String | value | ) |
Decode LayerMask.
Value is encoded as "bit1 bit2 ... bitN".
References decodeStringList(), and new().
Referenced by encodeCollisionFilter().
| Point Dragengine.Utils.CodecPropertyString.decodePoint | ( | String | string | ) |
Decode property string into a 2-component point.
Referenced by encodeCollisionFilter().
| RectArea Dragengine.Utils.CodecPropertyString.decodeRectArea | ( | String | string | ) |
Decode property string into a rectangular area.
References new(), and pTokenSeparators.
Referenced by encodeCollisionFilter().
| ShapeList Dragengine.Utils.CodecPropertyString.decodeShapeList | ( | String | string | ) |
Decode property string into a shape list.
References decodeFixedIntList(), new(), and pTokenSeparators.
Referenced by encodeCollisionFilter().
| Dictionary Dragengine.Utils.CodecPropertyString.decodeStringDictionary | ( | String | string | ) |
Decode property string into a dictionary of key/value strings.
Key/value pairs are obtained using decodeStringList(). Key and value are separated by pKeyValueSeparator.
References isTrue().
Referenced by encodeCollisionFilter().
| Array Dragengine.Utils.CodecPropertyString.decodeStringList | ( | String | string | ) |
Decode property string into a list of strings.
References pEncodeTokenSeparator.
Referenced by decodeLayerMask(), and encodeCollisionFilter().
| Vector2 Dragengine.Utils.CodecPropertyString.decodeVector2 | ( | String | string | ) |
Decode property string into a 2-component vector.
References decodeFloatList(), isFalse(), pTokenSeparators, and pTrueValues.
Referenced by encodeCollisionFilter().
| String Dragengine.Utils.CodecPropertyString.encodeCollisionFilter | ( | CollisionFilter | collisionFilter, |
| Dictionary | filterBitMap ) |
Encode CollisionFilter using filter bit map.
References decodeCollisionFilter(), decodeColor3(), decodeColor4(), decodeDVector(), decodeFixedIntList(), decodeFloatRectArea(), decodeLayerMask(), decodePoint(), decodeRectArea(), decodeShapeList(), decodeStringDictionary(), decodeStringList(), decodeVector2(), encodeCollisionFilter(), encodeColor3(), encodeColor4(), encodeDVector(), encodeFloatRectArea(), encodeLayerMask(), encodePoint(), encodeRectArea(), encodeShapeList(), encodeStringDictionary(), encodeStringList(), encodeVector2(), new(), pEncodeTokenSeparator, pKeyValueSeparator, pShapeParameterSeparator, pShapeValueSeparator, and pTokenSeparators.
Referenced by encodeCollisionFilter().
| String Dragengine.Utils.CodecPropertyString.encodeColor3 | ( | Color | color | ) |
Encode a 3-component color into a property string.
Referenced by encodeCollisionFilter().
| String Dragengine.Utils.CodecPropertyString.encodeColor4 | ( | Color | color | ) |
Encode a 4-component color into a property string.
Referenced by encodeCollisionFilter().
| String Dragengine.Utils.CodecPropertyString.encodeDVector | ( | DVector | vector | ) |
Encode a 3-component dvector into a property string.
Referenced by encodeCollisionFilter().
| String Dragengine.Utils.CodecPropertyString.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.
Referenced by encodeCollisionFilter().
| String Dragengine.Utils.CodecPropertyString.encodeLayerMask | ( | LayerMask | mask | ) |
Encode LayerMask.
Referenced by encodeCollisionFilter().
| String Dragengine.Utils.CodecPropertyString.encodeLayerMask | ( | LayerMask | mask, |
| Dictionary | layerMap ) |
Encode LayerMask using layer bit map.
| String Dragengine.Utils.CodecPropertyString.encodePoint | ( | Point | point | ) |
Encode a 2-component point into a property string.
Referenced by encodeCollisionFilter().
| String Dragengine.Utils.CodecPropertyString.encodeRectArea | ( | RectArea | area | ) |
Encode a rectangular area into a property string.
Referenced by encodeCollisionFilter().
| String Dragengine.Utils.CodecPropertyString.encodeShapeList | ( | ShapeList | list | ) |
Encode shape list into a property string.
References pTokenSeparators.
Referenced by encodeCollisionFilter().
| String Dragengine.Utils.CodecPropertyString.encodeStringDictionary | ( | Dictionary | dict | ) |
Encode a string dictionary into a property string.
Referenced by encodeCollisionFilter().
| String Dragengine.Utils.CodecPropertyString.encodeStringList | ( | Array | list | ) |
Encode a string list into a property string.
Referenced by encodeCollisionFilter().
| String Dragengine.Utils.CodecPropertyString.encodeVector2 | ( | Vector2 | vector | ) |
Encode a 2-component vector into a property string.
Referenced by encodeCollisionFilter().
| byte Dragengine.Utils.CodecPropertyString.getEncodeTokenSeparator | ( | ) |
Character to separate tokens with for encoding.
References pShapeParameterSeparator, and setShapeParameterSeparator().
Referenced by isFalse().
| byte Dragengine.Utils.CodecPropertyString.getKeyValueSeparator | ( | ) |
Separator for key and value in dictionaries.
References setTokenSeparators().
Referenced by getShapeParameterSeparator().
| byte Dragengine.Utils.CodecPropertyString.getShapeParameterSeparator | ( | ) |
Shape parameter separator character.
References getKeyValueSeparator(), and pKeyValueSeparator.
Referenced by getShapeValueSeparator().
| byte Dragengine.Utils.CodecPropertyString.getShapeValueSeparator | ( | ) |
Shape value separator character.
References getShapeParameterSeparator().
Referenced by setEncodeTokenSeparator().
| String Dragengine.Utils.CodecPropertyString.getTokenSeparators | ( | ) |
Basic separators for tokens in property strings containing multiple values.
Referenced by setTokenSeparators().
| bool Dragengine.Utils.CodecPropertyString.isFalse | ( | String | value | ) |
Value does not equal "true", "yes" or "1".
References getEncodeTokenSeparator(), and pEncodeTokenSeparator.
Referenced by decodeVector2().
| bool Dragengine.Utils.CodecPropertyString.isTrue | ( | String | value | ) |
Value equals "true", "yes" or "1".
References pShapeValueSeparator, and setShapeValueSeparator().
Referenced by decodeStringDictionary().
| CodecPropertyString Dragengine.Utils.CodecPropertyString.new | ( | ) |
Create codec.
References pEncodeTokenSeparator, pKeyValueSeparator, pShapeParameterSeparator, pShapeValueSeparator, and pTokenSeparators.
Referenced by decodeLayerMask(), decodeRectArea(), decodeShapeList(), and encodeCollisionFilter().
| void Dragengine.Utils.CodecPropertyString.setEncodeTokenSeparator | ( | byte | separator | ) |
Set character to separate tokens with for encoding.
References getShapeValueSeparator(), and pShapeValueSeparator.
Referenced by decodeFixedIntList().
| void Dragengine.Utils.CodecPropertyString.setKeyValueSeparator | ( | byte | separator | ) |
Set separator for key and value in dictionaries.
References pTokenSeparators.
Referenced by setShapeParameterSeparator().
| void Dragengine.Utils.CodecPropertyString.setShapeParameterSeparator | ( | byte | separator | ) |
Set shape parameter separator character.
References pKeyValueSeparator, and setKeyValueSeparator().
Referenced by getEncodeTokenSeparator().
| void Dragengine.Utils.CodecPropertyString.setShapeValueSeparator | ( | byte | separator | ) |
Set shape value separator character.
References pShapeParameterSeparator.
Referenced by isTrue().
| void Dragengine.Utils.CodecPropertyString.setTokenSeparators | ( | String | separators | ) |
Set basic separators for tokens in property strings containing multiple values.
References getTokenSeparators(), and pTokenSeparators.
Referenced by getKeyValueSeparator().
| byte Dragengine.Utils.CodecPropertyString.pEncodeTokenSeparator |
Character to separate tokens with for encoding.
Referenced by decodeStringList(), encodeCollisionFilter(), isFalse(), and new().
| byte Dragengine.Utils.CodecPropertyString.pKeyValueSeparator |
Separator for key and value in dictionaries.
Referenced by encodeCollisionFilter(), getShapeParameterSeparator(), new(), and setShapeParameterSeparator().
| byte Dragengine.Utils.CodecPropertyString.pShapeParameterSeparator |
Shape parameter separator character.
Referenced by encodeCollisionFilter(), getEncodeTokenSeparator(), new(), and setShapeValueSeparator().
| byte Dragengine.Utils.CodecPropertyString.pShapeValueSeparator |
Shape value separator character.
Referenced by encodeCollisionFilter(), isTrue(), new(), and setEncodeTokenSeparator().
| String Dragengine.Utils.CodecPropertyString.pTokenSeparators |
Basic separators for tokens in property strings containing multiple values.
Referenced by decodeCollisionFilter(), decodeRectArea(), decodeShapeList(), decodeVector2(), encodeCollisionFilter(), encodeShapeList(), new(), setKeyValueSeparator(), and setTokenSeparators().
|
static |
Referenced by decodeDVector(), and decodeVector2().