QGearsMapFileXMLSerializer.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. -----------------------------------------------------------------------------
  3. Copyright (c) 27.10.2013 Tobias Peters <tobias.peters@kreativeffekt.at>
  4. This file is part of Q-Gears
  5. Q-Gears is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, version 2.0 (GPLv2) of the License.
  8. Q-Gears is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. -----------------------------------------------------------------------------
  13. */
  14. #ifndef __QGearsMapFileXMLSerializer_H__
  15. #define __QGearsMapFileXMLSerializer_H__
  16. #include "common/TypeDefine.h"
  17. #include "data/QGearsXMLSerializer.h"
  18. #include "QGearsMapFile.h"
  19. namespace QGears
  20. {
  21. class MapFileXMLSerializer : public XMLSerializer
  22. {
  23. public:
  24. MapFileXMLSerializer();
  25. virtual ~MapFileXMLSerializer();
  26. virtual void importMapFile( Ogre::DataStreamPtr &stream, MapFile *pDest );
  27. typedef MapFile::Point Point;
  28. typedef MapFile::PointList PointList;
  29. typedef MapFile::Trigger Trigger;
  30. typedef MapFile::TriggerList TriggerList;
  31. protected:
  32. virtual void readHeader( TiXmlNode *node );
  33. virtual void readScript( TiXmlNode &node, MapFile *pDest );
  34. virtual void readBackground2D( TiXmlNode &node, MapFile *pDest );
  35. virtual void readWalkmesh( TiXmlNode &node, MapFile *pDest );
  36. virtual void readForwardDirection( TiXmlNode &node, MapFile *pDest );
  37. virtual void readEntities( TiXmlNode &node, MapFile *pDest );
  38. virtual void readObject( TiXmlNode &node, Point &pDest );
  39. virtual void readObject( TiXmlNode &node, Trigger &pDest );
  40. template<typename ValueType> void
  41. readEntities( TiXmlNode &node, const String &tag, std::vector<ValueType> &pDest );
  42. private:
  43. };
  44. }
  45. #endif // __QGearsMapFileXMLSerializer_H__