CInitializer.h 931 B

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "WallpaperEngine/Core/Core.h"
  3. namespace WallpaperEngine::Core::Objects::Particles
  4. {
  5. using json = nlohmann::json;
  6. /**
  7. * Initializer for particles, controls the different attributes a particle will have
  8. * on emission
  9. */
  10. class CInitializer
  11. {
  12. public:
  13. static CInitializer* fromJSON (json data);
  14. /**
  15. * @return The name of the particle initializer, indicates what type of initialization to do
  16. */
  17. [[nodiscard]] const std::string& getName () const;
  18. /**
  19. * @return The id of the initializer
  20. */
  21. [[nodiscard]] uint32_t getId () const;
  22. protected:
  23. CInitializer (uint32_t id, std::string name);
  24. private:
  25. /** ID for ordering purposes */
  26. uint32_t m_id;
  27. /** The name of the initializer, indicates what type of initialization to do */
  28. std::string m_name;
  29. };
  30. }