stmm-games-doc  0.32.0
Public Member Functions | List of all members
stmg::XmlTraitsParser Class Reference

Public Member Functions

 XmlTraitsParser (XmlConditionalParser &oXmlConditionalParser)
 Constructor. More...
 
XmlConditionalParsergetXmlConditionalParser ()
 
void parseTile (ConditionalCtx &oCtx, const xmlpp::Element *p0Element, Tile &oTile)
 Parse all the traits of tile within the same element. More...
 
void parseColor (ConditionalCtx &oCtx, const xmlpp::Element *p0Element, TileColor &oTileColor)
 Parse the tile color. More...
 
void parseAlpha (ConditionalCtx &oCtx, const xmlpp::Element *p0Element, TileAlpha &oTileAlpha)
 Parse the tile alpha. More...
 
void parseChar (ConditionalCtx &oCtx, const xmlpp::Element *p0Element, TileChar &oTileChar)
 Parse the tile char. More...
 
void parseFont (ConditionalCtx &oCtx, const xmlpp::Element *p0Element, TileFont &oTileFont)
 Parse the tile font. More...
 
void parseGamma (ConditionalCtx &oCtx, const xmlpp::Element *p0Element, TileGamma &oTileGamma)
 Parse the tile gamma. More...
 
void parseTheta (ConditionalCtx &oCtx, const xmlpp::Element *p0Element, TileTheta &oTileTheta)
 Parse the tile theta. More...
 
void parseChars (ConditionalCtx &oCtx, const xmlpp::Element *p0Element, CharTraitSet &oTraitSet)
 Parse a char trait set. More...
 
void parseColors (ConditionalCtx &oCtx, const xmlpp::Element *p0Element, bool bAllowRgbFromTo, ColorTraitSet &oTraitSet)
 Parse a color trait set. More...
 
void parseFonts (ConditionalCtx &oCtx, const xmlpp::Element *p0Element, FontTraitSet &oTraitSet)
 Parse a font trait set. More...
 
void parseAlphas (ConditionalCtx &oCtx, const xmlpp::Element *p0Element, AlphaTraitSet &oTraitSet)
 Parse a alpha trait set. More...
 
void parseGammas (ConditionalCtx &oCtx, const xmlpp::Element *p0Element, GammaTraitSet &oTraitSet)
 Parse a gamma trait set. More...
 
void parseThetas (ConditionalCtx &oCtx, const xmlpp::Element *p0Element, ThetaTraitSet &oTraitSet)
 Parse a theta trait set. More...
 
void parsePlayers (ConditionalCtx &oCtx, const xmlpp::Element *p0Element, IntSet &oIntSet)
 Parse a player trait set. More...
 
std::unique_ptr< TileSelectorparseTileSelectorOr (ConditionalCtx &oCtx, const xmlpp::Element *p0Element)
 Parses a tile selector with children elements tied by an "or" condition. More...
 
std::unique_ptr< TileSelectorparseTileSelectorAnd (ConditionalCtx &oCtx, const xmlpp::Element *p0Element)
 Parses a tile selector with children elements tied by an "and" condition. More...
 
std::unique_ptr< TileSelectorparseTileSelector (ConditionalCtx &oCtx, const xmlpp::Element *p0Element)
 Calls parseTileSelectorOr. More...
 

Constructor & Destructor Documentation

◆ XmlTraitsParser()

stmg::XmlTraitsParser::XmlTraitsParser ( XmlConditionalParser oXmlConditionalParser)
inline

Constructor.

Parameters
oXmlConditionalParserThe conditional parser to use.

Member Function Documentation

◆ getXmlConditionalParser()

XmlConditionalParser& stmg::XmlTraitsParser::getXmlConditionalParser ( )
inline

◆ parseAlpha()

void stmg::XmlTraitsParser::parseAlpha ( ConditionalCtx oCtx,
const xmlpp::Element *  p0Element,
TileAlpha oTileAlpha 
)

Parse the tile alpha.

If the trait is not defined the input/output value oTileAlpha is left unchanged.

Parameters
oCtxThe context.
p0ElementThe element. Cannot be null.
oTileAlphaThe possibly modified tile alpha.

◆ parseAlphas()

void stmg::XmlTraitsParser::parseAlphas ( ConditionalCtx oCtx,
const xmlpp::Element *  p0Element,
AlphaTraitSet oTraitSet 
)

Parse a alpha trait set.

If the trait is defined the trait set is overwritten otherwise it is left unchanged.

Parameters
oCtxThe context.
p0ElementThe element. Cannot be null.
oTraitSetThe alpha trait set.

◆ parseChar()

void stmg::XmlTraitsParser::parseChar ( ConditionalCtx oCtx,
const xmlpp::Element *  p0Element,
TileChar oTileChar 
)

Parse the tile char.

If the trait is not defined the input/output value oTileChar is left unchanged.

Parameters
oCtxThe context.
p0ElementThe element. Cannot be null.
oTileCharThe possibly modified tile char.

◆ parseChars()

void stmg::XmlTraitsParser::parseChars ( ConditionalCtx oCtx,
const xmlpp::Element *  p0Element,
CharTraitSet oTraitSet 
)

Parse a char trait set.

If the trait is defined the trait set is overwritten otherwise it is left unchanged.

Parameters
oCtxThe context.
p0ElementThe element. Cannot be null.
oTraitSetThe char trait set.

◆ parseColor()

void stmg::XmlTraitsParser::parseColor ( ConditionalCtx oCtx,
const xmlpp::Element *  p0Element,
TileColor oTileColor 
)

Parse the tile color.

If the trait is not defined the input/output value oTileColor is left unchanged.

Parameters
oCtxThe context.
p0ElementThe element. Cannot be null.
oTileColorThe possibly modified tile color.

◆ parseColors()

void stmg::XmlTraitsParser::parseColors ( ConditionalCtx oCtx,
const xmlpp::Element *  p0Element,
bool  bAllowRgbFromTo,
ColorTraitSet oTraitSet 
)

Parse a color trait set.

If the trait is defined the trait set is overwritten otherwise it is left unchanged.

Parameters
oCtxThe context.
p0ElementThe element. Cannot be null.
bAllowRgbFromToWhether from to of rgb values is allowed.
oTraitSetThe color trait set.

◆ parseFont()

void stmg::XmlTraitsParser::parseFont ( ConditionalCtx oCtx,
const xmlpp::Element *  p0Element,
TileFont oTileFont 
)

Parse the tile font.

If the trait is not defined the input/output value oTileFont is left unchanged.

Parameters
oCtxThe context.
p0ElementThe element. Cannot be null.
oTileFontThe possibly modified tile font.

◆ parseFonts()

void stmg::XmlTraitsParser::parseFonts ( ConditionalCtx oCtx,
const xmlpp::Element *  p0Element,
FontTraitSet oTraitSet 
)

Parse a font trait set.

If the trait is defined the trait set is overwritten otherwise it is left unchanged.

Parameters
oCtxThe context.
p0ElementThe element. Cannot be null.
oTraitSetThe font trait set.

◆ parseGamma()

void stmg::XmlTraitsParser::parseGamma ( ConditionalCtx oCtx,
const xmlpp::Element *  p0Element,
TileGamma oTileGamma 
)

Parse the tile gamma.

If the trait is not defined the input/output value oTileGamma is left unchanged.

Parameters
oCtxThe context.
p0ElementThe element. Cannot be null.
oTileGammaThe possibly modified tile gamma.

◆ parseGammas()

void stmg::XmlTraitsParser::parseGammas ( ConditionalCtx oCtx,
const xmlpp::Element *  p0Element,
GammaTraitSet oTraitSet 
)

Parse a gamma trait set.

If the trait is defined the trait set is overwritten otherwise it is left unchanged.

Parameters
oCtxThe context.
p0ElementThe element. Cannot be null.
oTraitSetThe gamma trait set.

◆ parsePlayers()

void stmg::XmlTraitsParser::parsePlayers ( ConditionalCtx oCtx,
const xmlpp::Element *  p0Element,
IntSet oIntSet 
)

Parse a player trait set.

If the trait is defined the trait set is overwritten otherwise it is left unchanged.

Parameters
oCtxThe context.
p0ElementThe element. Cannot be null.
oIntSetThe player trait set.

◆ parseTheta()

void stmg::XmlTraitsParser::parseTheta ( ConditionalCtx oCtx,
const xmlpp::Element *  p0Element,
TileTheta oTileTheta 
)

Parse the tile theta.

If the trait is not defined the input/output value oTileTheta is left unchanged.

Parameters
oCtxThe context.
p0ElementThe element. Cannot be null.
oTileThetaThe possibly modified tile theta.

◆ parseThetas()

void stmg::XmlTraitsParser::parseThetas ( ConditionalCtx oCtx,
const xmlpp::Element *  p0Element,
ThetaTraitSet oTraitSet 
)

Parse a theta trait set.

If the trait is defined the trait set is overwritten otherwise it is left unchanged.

Parameters
oCtxThe context.
p0ElementThe element. Cannot be null.
oTraitSetThe theta trait set.

◆ parseTile()

void stmg::XmlTraitsParser::parseTile ( ConditionalCtx oCtx,
const xmlpp::Element *  p0Element,
Tile oTile 
)

Parse all the traits of tile within the same element.

If a trait is not defined its value in input/output parameter oTile is left unchanged, otherwise it is overwritten.

Parameters
oCtxThe context.
p0ElementThe element. Cannot be null.
oTileThe possibly modified tile.

◆ parseTileSelector()

std::unique_ptr<TileSelector> stmg::XmlTraitsParser::parseTileSelector ( ConditionalCtx oCtx,
const xmlpp::Element *  p0Element 
)
inline

Calls parseTileSelectorOr.

◆ parseTileSelectorAnd()

std::unique_ptr<TileSelector> stmg::XmlTraitsParser::parseTileSelectorAnd ( ConditionalCtx oCtx,
const xmlpp::Element *  p0Element 
)

Parses a tile selector with children elements tied by an "and" condition.

Parameters
oCtxThe context.
p0ElementThe element. Cannot be null.
Returns
The tile selector. Is not null.

◆ parseTileSelectorOr()

std::unique_ptr<TileSelector> stmg::XmlTraitsParser::parseTileSelectorOr ( ConditionalCtx oCtx,
const xmlpp::Element *  p0Element 
)

Parses a tile selector with children elements tied by an "or" condition.

Parameters
oCtxThe context.
p0ElementThe element. Cannot be null.
Returns
The tile selector. Is not null.