QGearsMapFile.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 __QGearsMapFile_H__
  15. #define __QGearsMapFile_H__
  16. #include "common/QGearsResource.h"
  17. #include "core/EntityPoint.h"
  18. #include "core/EntityTrigger.h"
  19. namespace QGears
  20. {
  21. class MapFile : public Resource
  22. {
  23. public:
  24. static const String RESOURCE_TYPE;
  25. MapFile( Ogre::ResourceManager *creator, const String &name
  26. ,Ogre::ResourceHandle handle, const String &group
  27. ,bool isManual = false, Ogre::ManualResourceLoader *loader = NULL );
  28. virtual ~MapFile();
  29. typedef EntityPoint Point;
  30. typedef std::vector<Point> PointList;
  31. typedef EntityTrigger Trigger;
  32. typedef std::vector<Trigger> TriggerList;
  33. virtual const String& getScriptName ( void ) const;
  34. virtual const String& getBackground2dName ( void ) const;
  35. virtual const String& getWalkmeshName ( void ) const;
  36. virtual const Ogre::Real& getForwardDirection ( void ) const;
  37. virtual PointList& getPoints ( void );
  38. virtual TriggerList& getTriggers ( void );
  39. virtual void setScriptName ( const String &script_name );
  40. virtual void setBackground2dName( const String &background2d_name );
  41. virtual void setWalkmeshName ( const String &walkmesh_name );
  42. virtual void setForwardDirection( const Ogre::Real &forward_direction );
  43. protected:
  44. virtual void loadImpl( void );
  45. virtual void unloadImpl( void );
  46. virtual size_t calculateSize( void ) const;
  47. private:
  48. String m_script_name;
  49. String m_background2d_name;
  50. String m_walkmesh_name;
  51. Ogre::Real m_forward_direction;
  52. PointList m_points;
  53. TriggerList m_triggers;
  54. };
  55. typedef Ogre::SharedPtr<MapFile> MapFilePtr;
  56. }
  57. #endif // __QGearsMapFile_H__