object.h 878 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include <nlohmann/json.hpp>
  3. #include <irrlicht/irrlicht.h>
  4. #include "objects/effect.h"
  5. namespace wp::core
  6. {
  7. using json = nlohmann::json;
  8. class object
  9. {
  10. public:
  11. static object* fromJSON (json data);
  12. std::vector<objects::effect*>* getEffects ();
  13. protected:
  14. object (
  15. bool visible,
  16. irr::u32 id,
  17. std::string name,
  18. const irr::core::vector3df& origin,
  19. const irr::core::vector3df& scale,
  20. const irr::core::vector3df& angles
  21. );
  22. void insertEffect (objects::effect* effect);
  23. private:
  24. bool m_visible;
  25. irr::u32 m_id;
  26. std::string m_name;
  27. irr::core::vector3df m_origin;
  28. irr::core::vector3df m_scale;
  29. irr::core::vector3df m_angles;
  30. std::vector<objects::effect*> m_effects;
  31. };
  32. };