Drag[en]gine Script Module DragonScript Script API  1.0
BaseXmlLoader Class Reference
Inheritance diagram for BaseXmlLoader:
LoadAnnouncer LoadDynamicMusic LoadVoice LoadAnimator LoadBorder LoadCanvasCreator LoadConversation LoadDecoration LoadDesigner LoadElementClass LoadGuiTheme LoadHeightTerrainSector LoadKeyBindings LoadMaterialSoundMatrix LoadParticleEmitter LoadSpeechAnimation LoadStyledTextDefinition LoadSynthesizer LoadWorld LoadWorldSector

Public Member Functions

Console getConsole ()
 
String getName ()
 
int hexToInt (byte hex)
 
void logDeprecated (EasyXMLElement tag, String whatIsDeprecated)
 
void logDeprecated (EasyXMLElement tag, String whatIsDeprecated, String useWhatInstead)
 
void logDeprecatedTag (EasyXMLElement tag)
 
void logDuplicateObject (EasyXMLElement tag, String object, String identifier)
 Output error message duplicate object on the application console. More...
 
void logIncompatibleAttributes (EasyXMLElement tag, String attributeNames)
 
void logInvalidAttributeValue (EasyXMLElement tag, String attribute, String value)
 
void logInvalidEmptyString (EasyXMLElement tag)
 
void logInvalidValue (EasyXMLElement tag, String value)
 
void logLoadFileFailed (EasyXMLElement tag, String filename)
 
void logLoadingFailed (String filename)
 Log loading file failed with error log. More...
 
void logLoadingFromFile (String filename)
 
void logMissingAttribute (EasyXMLElement tag, String attrName)
 
void logMissingCData (EasyXMLElement tag)
 
void logMissingTag (String tagName)
 
void logNotSupported (EasyXMLElement tag, String whatIsNotSupported)
 
void logObjectExists (EasyXMLElement tag, String object, String value)
 Output error message value exists already on the application console. More...
 
void logParsingFailed (String errorLog)
 
void logUnknownTag (EasyXMLElement tag)
 
BaseXmlLoader new (Console console, String name)
 
void printOnConsole (String message)
 
void printOnConsole (EasyXMLElement tag, String errorMessage)
 
BorderSize readBorderSize (EasyXMLElement root)
 Read border size area. More...
 
String readCData (EasyXMLElement tag)
 
bool readCDataBool (EasyXMLElement tag)
 
float readCDataFloat (EasyXMLElement tag)
 
int readCDataHex (EasyXMLElement tag)
 
int readCDataInt (EasyXMLElement tag)
 
Color readColor (EasyXMLElement root)
 
Color readColor (EasyXMLElement root, Color defaultColor)
 
ColorMatrix readColorMatrix (EasyXMLElement root)
 Read color matrix. More...
 
CurveBezier readCurveBezier (EasyXMLElement root)
 
void readCurveBezierPoint (EasyXMLElement root, CurveBezier curve)
 
DVector readDVector (EasyXMLElement root)
 
FloatRectArea readFloatRectArea (EasyXMLElement root)
 Read floating point rectangular area. More...
 
Font readFont (EasyXMLElement root)
 
Point readPoint (EasyXMLElement root)
 
RectArea readRectArea (EasyXMLElement root)
 Read rectangular area. More...
 
Vector readVector (EasyXMLElement root)
 
Vector2 readVector2 (EasyXMLElement root)
 
Vector2 readVector2UV (EasyXMLElement root)
 

Public Attributes

Console pConsole
 Console to print messages to. More...
 
String pName
 Name of the loader object for error reporting. More...
 

Detailed Description

Basic xml loader class providing functionality useful across various xml file loaders. Stores also a name and a console so the error functions are more generic.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Function Documentation

Console getConsole ( )

Retrieves the console.

String getName ( )

Retrieves the name.

int hexToInt ( byte  hex)

Converts a hex value to an integer value.

void logDeprecated ( EasyXMLElement  tag,
String  whatIsDeprecated 
)

Outputs an deprecated message on the application console.

void logDeprecated ( EasyXMLElement  tag,
String  whatIsDeprecated,
String  useWhatInstead 
)

Outputs an deprecated message on the application console.

void logDeprecatedTag ( EasyXMLElement  tag)

Outputs an deprecated message on the application console.

void logDuplicateObject ( EasyXMLElement  tag,
String  object,
String  identifier 
)

Output error message duplicate object on the application console.

void logIncompatibleAttributes ( EasyXMLElement  tag,
String  attributeNames 
)

Outputs error message about incompatible attributes.

void logInvalidAttributeValue ( EasyXMLElement  tag,
String  attribute,
String  value 
)

Outputs error message invalid attribute value on the application console.

void logInvalidEmptyString ( EasyXMLElement  tag)

Outputs error message invalid empty string on the application console.

void logInvalidValue ( EasyXMLElement  tag,
String  value 
)

Outputs error message invalid value on the application console.

void logLoadFileFailed ( EasyXMLElement  tag,
String  filename 
)

Outputs error message about a failure to load another file or resource.

void logLoadingFailed ( String  filename)

Log loading file failed with error log.

void logLoadingFromFile ( String  filename)

Log filename on the application console.

void logMissingAttribute ( EasyXMLElement  tag,
String  attrName 
)

Outputs error message missing attribute on the application console.

void logMissingCData ( EasyXMLElement  tag)

Outputs error message missing attribute on the application console.

void logMissingTag ( String  tagName)

Outputs error message missing tag on the application console.

void logNotSupported ( EasyXMLElement  tag,
String  whatIsNotSupported 
)

Outputs error message about a feature not being supported.

void logObjectExists ( EasyXMLElement  tag,
String  object,
String  value 
)

Output error message value exists already on the application console.

void logParsingFailed ( String  errorLog)

Log parsing failed with error log.

void logUnknownTag ( EasyXMLElement  tag)

Outputs error message invalid axis on the application console.

BaseXmlLoader new ( Console  console,
String  name 
)

Creates a new base file loader.

void printOnConsole ( String  message)

Outputs an error message on the application console.

void printOnConsole ( EasyXMLElement  tag,
String  errorMessage 
)

Outputs an error message on the application console.

BorderSize readBorderSize ( EasyXMLElement  root)

Read border size area.

String readCData ( EasyXMLElement  tag)

Read CData as string. If no CData is specified an empty string is returned.

bool readCDataBool ( EasyXMLElement  tag)

Read a boolean CData. The value true is mapped to true and anything else to false. If no CData is specified false is returned.

float readCDataFloat ( EasyXMLElement  tag)

Read CData as float. If no CData is specified 0 is returned.

int readCDataHex ( EasyXMLElement  tag)

Read CData as int where the value is stored hexadecial. If no CData is specified 0 is returned. The hexadecimal value is specified as a one or two character value. The characters have to be in the range from 0 to 9, a to f or A to F. No prefix is used. If more than two characters are specified only the first two are used.

int readCDataInt ( EasyXMLElement  tag)

Read CData as int. If no CData is specified 0 is returned.

Color readColor ( EasyXMLElement  root)

Read color tag. The color components are defined using one or more child tags. One group of tags is red, green, blue and alpha to specify the color components in the range from 0 to 1. Another group of tags is intRed, intGreen, intBlue and intAlpha to specify the color components in the range from 0 to 255 where 0 equals to 0 intensity and 255 equals to full intensity. A third group of tags is hexRed, hexGreen, hexBlue and hexAlpha to specify the color components using a 1 or 2 digit hexadecimal number. The hexadecimal number can contain upper or lower case alphabetic characters. No prefix is required. If a component is not specified the default value is used which is 0 for red, green and blue and 1 for alpha.

Color readColor ( EasyXMLElement  root,
Color  defaultColor 
)

Read color tag. The color components are defined using one or more child tags. One group of tags is red, green, blue and alpha to specify the color components in the range from 0 to 1. Another group of tags is intRed, intGreen, intBlue and intAlpha to specify the color components in the range from 0 to 255 where 0 equals to 0 intensity and 255 equals to full intensity. A third group of tags is hexRed, hexGreen, hexBlue and hexAlpha to specify the color components using a 1 or 2 digit hexadecimal number. The hexadecimal number can contain upper or lower case alphabetic characters. No prefix is required. If a component is not specified the default value is used which is 0 for red, green and blue and 1 for alpha.

ColorMatrix readColorMatrix ( EasyXMLElement  root)

Read color matrix.

CurveBezier readCurveBezier ( EasyXMLElement  root)

Read curve tag.

void readCurveBezierPoint ( EasyXMLElement  root,
CurveBezier  curve 
)

Read curve point tag.

DVector readDVector ( EasyXMLElement  root)

Read double vector tag.

FloatRectArea readFloatRectArea ( EasyXMLElement  root)

Read floating point rectangular area.

Font readFont ( EasyXMLElement  root)

Parse font tag. The font properties are defined using child tags. The file tag defines the font file to use while the size tag defines the size of the font object. The size is given as the height of the font in pixels. Both tags are required. If one or both are missing a null font object is returned.

Point readPoint ( EasyXMLElement  root)

Read point tag.

RectArea readRectArea ( EasyXMLElement  root)

Read rectangular area.

Vector readVector ( EasyXMLElement  root)

Read vector tag.

Vector2 readVector2 ( EasyXMLElement  root)

Read vector2 tag.

Vector2 readVector2UV ( EasyXMLElement  root)

Read vector2 tag using the uv instead of xy notation.

Member Data Documentation

Console pConsole

Console to print messages to.

String pName

Name of the loader object for error reporting.


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