V-Gears 0
Free Final Fantasy VII engine.
VGears::MapFileXMLSerializer Class Reference

Handles the serialization of map XML files. More...

#include <VGearsMapFileXMLSerializer.h>

Inheritance diagram for VGears::MapFileXMLSerializer:
Collaboration diagram for VGears::MapFileXMLSerializer:

Public Types

typedef MapFile::Point Point
 
typedef MapFile::PointList PointList
 
typedef MapFile::Trigger Trigger
 
typedef MapFile::TriggerList TriggerList
 

Public Member Functions

 MapFileXMLSerializer ()
 Constructor. More...
 
virtual ~MapFileXMLSerializer ()
 Destructor. More...
 
virtual void ImportMapFile (Ogre::DataStreamPtr &stream, MapFile *dest)
 Imports a map file. More...
 
- Public Member Functions inherited from VGears::XMLSerializer
 XMLSerializer ()
 Constructor. More...
 
virtual ~XMLSerializer ()
 Destructor. More...
 

Protected Member Functions

virtual void ReadHeader (TiXmlNode *node)
 Reads a file header from an XML node and sets the instance data. More...
 
virtual void ReadScript (TiXmlNode &node, MapFile *dest)
 Reads the script file location from the field XML file. More...
 
virtual void ReadBackground2D (TiXmlNode &node, MapFile *dest)
 Reads the backgrouns file location from the field XML file. More...
 
virtual void ReadTexts (TiXmlNode &node, MapFile *dest)
 Reads the text file location from the field XML file. More...
 
virtual void ReadWalkmesh (TiXmlNode &node, MapFile *dest)
 Reads the walkmesh file location from the field XML file. More...
 
virtual void ReadForwardDirection (TiXmlNode &node, MapFile *dest)
 Reads the field forward direction location from the field XML file. More...
 
virtual void ReadEntities (TiXmlNode &node, MapFile *dest)
 Reads the entities location from the field XML file. More...
 
virtual void readObject (TiXmlNode &node, Point &dest)
 Reads an object from the field XML file. More...
 
virtual void readObject (TiXmlNode &node, Trigger &dest)
 Reads a trigger from the field XML file. More...
 
template<typename ValueType >
void ReadEntities (TiXmlNode &node, const String &tag, std::vector< ValueType > &dest)
 Reads entities from a map. More...
 
- Protected Member Functions inherited from VGears::XMLSerializer
virtual void Parse (Ogre::DataStreamPtr &stream, TiXmlDocument &dest)
 Reads and parses the XML file. More...
 
virtual const StringReadAttribute (TiXmlNode &node, const String &attribute)
 Reads an XMl node attribute as a string. More...
 
virtual bool ReadAttribute (TiXmlNode &node, const String &attribute, bool &dest, const bool &def=false)
 Reads an XMl node attribute as a boolean. More...
 
virtual bool ReadAttribute (TiXmlNode &node, const String &attribute, int &dest, const int &def=0)
 Reads an XMl node attribute as an integer. More...
 
virtual bool ReadAttribute (TiXmlNode &node, const String &attribute, String &dest, const String &def="")
 Reads an XMl node attribute as a string. More...
 
virtual bool ReadAttribute (TiXmlNode &node, const String &attribute, Ogre::Real &dest, const Ogre::Real &def=0)
 Reads an XMl node attribute as a real. More...
 
virtual bool ReadAttribute (TiXmlNode &node, const String &attribute, Ogre::Vector2 &dest, const Ogre::Vector2 &def=Ogre::Vector2::ZERO)
 Reads an XMl node attribute as a 2-dimension vector. More...
 
virtual bool ReadAttribute (TiXmlNode &node, const String &attribute, Ogre::Vector3 &dest, const Ogre::Vector3 &def=Ogre::Vector3::ZERO)
 Reads an XMl node attribute as a 3-dimension vector. More...
 
virtual bool ReadAttribute (TiXmlNode &node, const String &attribute, Ogre::Vector4 &dest, const Ogre::Vector4 &def=Ogre::Vector4::ZERO)
 Reads an XMl node attribute as a 4-dimension vector. More...
 
virtual bool ReadAttribute (TiXmlNode &node, const String &attribute, Ogre::Quaternion &dest, const Ogre::Quaternion &def=Ogre::Quaternion::IDENTITY)
 Reads an XMl node attribute as a quaternion. More...
 
virtual TiXmlNode * FindChildNode (TiXmlNode &node, const String &tag)
 Finds a child node of a XML node by name. More...
 

Detailed Description

Handles the serialization of map XML files.

Member Typedef Documentation

◆ Point

◆ PointList

◆ Trigger

◆ TriggerList

Constructor & Destructor Documentation

◆ MapFileXMLSerializer()

VGears::MapFileXMLSerializer::MapFileXMLSerializer ( )

Constructor.

◆ ~MapFileXMLSerializer()

VGears::MapFileXMLSerializer::~MapFileXMLSerializer ( )
virtual

Destructor.

Member Function Documentation

◆ ImportMapFile()

void VGears::MapFileXMLSerializer::ImportMapFile ( Ogre::DataStreamPtr &  stream,
MapFile dest 
)
virtual

Imports a map file.

Parameters
[in]streamThe contents of the map file.
[out]destThe formed map file.

◆ ReadBackground2D()

void VGears::MapFileXMLSerializer::ReadBackground2D ( TiXmlNode &  node,
MapFile dest 
)
protectedvirtual

Reads the backgrouns file location from the field XML file.

Parameters
[in]nodeThe XML node to read.
[out]destThe background data will be loaded here.

◆ ReadEntities() [1/2]

template<typename ValueType >
void VGears::MapFileXMLSerializer::ReadEntities ( TiXmlNode &  node,
const String tag,
std::vector< ValueType > &  dest 
)
protected

Reads entities from a map.

Parameters
[in]nodeInput data.
[in]tagEntity section tag.
[out]destThe formed vector data.

◆ ReadEntities() [2/2]

void VGears::MapFileXMLSerializer::ReadEntities ( TiXmlNode &  node,
MapFile dest 
)
protectedvirtual

Reads the entities location from the field XML file.

Parameters
[in]nodeThe XML node to read.
[out]destThe entity data will be loaded here.

◆ ReadForwardDirection()

void VGears::MapFileXMLSerializer::ReadForwardDirection ( TiXmlNode &  node,
MapFile dest 
)
protectedvirtual

Reads the field forward direction location from the field XML file.

Parameters
[in]nodeThe XML node to read.
[out]destThe direction data will be loaded here.

◆ ReadHeader()

void VGears::MapFileXMLSerializer::ReadHeader ( TiXmlNode *  node)
protectedvirtual

Reads a file header from an XML node and sets the instance data.

Parameters
[in]nodeThe XML node to read.

◆ readObject() [1/2]

void VGears::MapFileXMLSerializer::readObject ( TiXmlNode &  node,
MapFileXMLSerializer::Point dest 
)
protectedvirtual

Reads an object from the field XML file.

Parameters
[in]nodeThe XML node to read.
[out]destThe formed point data.

◆ readObject() [2/2]

void VGears::MapFileXMLSerializer::readObject ( TiXmlNode &  node,
MapFileXMLSerializer::Trigger dest 
)
protectedvirtual

Reads a trigger from the field XML file.

Parameters
[in]nodeThe XML node to read.
[out]destThe formed trigger data.

◆ ReadScript()

void VGears::MapFileXMLSerializer::ReadScript ( TiXmlNode &  node,
MapFile dest 
)
protectedvirtual

Reads the script file location from the field XML file.

Parameters
[in]nodeThe XML node to read.
[out]destThe script data will be loaded here.

◆ ReadTexts()

void VGears::MapFileXMLSerializer::ReadTexts ( TiXmlNode &  node,
MapFile dest 
)
protectedvirtual

Reads the text file location from the field XML file.

Parameters
[in]nodeThe XML node to read.
[out]destThe background data will be loaded here.

◆ ReadWalkmesh()

void VGears::MapFileXMLSerializer::ReadWalkmesh ( TiXmlNode &  node,
MapFile dest 
)
protectedvirtual

Reads the walkmesh file location from the field XML file.

Parameters
[in]nodeThe XML node to read.
[out]destThe walkmesh data will be loaded here.

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