stmm-games-doc  0.32.0
Public Member Functions | List of all members
stmg::XmlLogEventParser Class Reference
Inheritance diagram for stmg::XmlLogEventParser:
Inheritance graph
[legend]

Public Member Functions

 XmlLogEventParser ()
 
EventparseEvent (GameCtx &oCtx, const xmlpp::Element *p0Element) override
 Parse and create an event instance. More...
 
- Public Member Functions inherited from stmg::XmlEventParser
virtual ~XmlEventParser ()=default
 
 XmlEventParser (const std::string &sEventName)
 Constructor. More...
 
const std::string & getEventName () const
 The event name. More...
 
virtual void recycleEvents (std::unique_ptr< Event > &refEvent)
 Recycle the event if it is of a type created by this instance. More...
 
virtual int32_t parseEventMsgName (ConditionalCtx &oCtx, const xmlpp::Element *p0Element, const std::string &sAttr, const std::string &sMsgName)
 Returns event type's msg value from msg name. More...
 
virtual int32_t parseEventListenerGroupName (GameCtx &oCtx, const xmlpp::Element *p0Element, const std::string &sAttr, const std::string &sListenerGroupName)
 Returns event type listener group value from name. More...
 

Additional Inherited Members

- Protected Member Functions inherited from stmg::XmlEventParser
bool getBlock (GameCtx &oCtx, const std::string &sName, Block &oBlock)
 Return named block. More...
 
EventparseChildEvent (GameCtx &oCtx, const xmlpp::Element *p0Element)
 Parses an event and adds it to the level. More...
 
void parseEventBase (GameCtx &oCtx, const xmlpp::Element *p0Element, Event::Init &oInit)
 Parse event base. More...
 
EventintegrateAndAdd (GameCtx &oCtx, unique_ptr< Event > refEvent, const xmlpp::Element *p0Element)
 Integrate the event add to level. More...
 
int32_t parseEventAttrRepeat (GameCtx &oCtx, const xmlpp::Element *p0EventElement)
 Helper function for the 'repeat' attribute. More...
 
int32_t parseEventAttrStep (GameCtx &oCtx, const xmlpp::Element *p0EventElement)
 Helper function for the 'step' attribute. More...
 
int32_t parseEventAttrRandomProb (GameCtx &oCtx, const xmlpp::Element *p0EventElement)
 Helper function for the 'prob' attribute. More...
 
bool isReservedChildElementOfEvent (const std::string &sElementName) const
 Tells whether a child element name of Event is reserved. More...
 
XmlConditionalParsergetXmlConditionalParser ()
 Get the conditional parser. More...
 
XmlTraitsParsergetXmlTraitsParser ()
 Get the traits parser. More...
 

Constructor & Destructor Documentation

◆ XmlLogEventParser()

stmg::XmlLogEventParser::XmlLogEventParser ( )

Member Function Documentation

◆ parseEvent()

Event* stmg::XmlLogEventParser::parseEvent ( GameCtx oCtx,
const xmlpp::Element *  p0Element 
)
overridevirtual

Parse and create an event instance.

The implementation must call integrateAndAdd() to add the newly created event to the level which will own it.

Parameters
oCtxThe game context.
p0ElementThe element. Cannot be null.
Returns
The created event. Non owning. Is not null.
Exceptions
std::runtime_error.

Implements stmg::XmlEventParser.