// // Created by SeanOMik on 3/21/2021. // Github: https://github.com/SeanOMik // Email: seanomik@gmail.com // #ifndef SIMPLEENGINE_PARTICLE_H #define SIMPLEENGINE_PARTICLE_H #include "../event.h" #include "particle_property.h" #include #include #include #include #include namespace simpleengine { namespace particle { class Particle : public simpleengine::Event { private: using Super = simpleengine::Event; protected: using ParticlePropertyPtr = std::shared_ptr; using ParticlePropertyVector = std::vector; public: Particle(sf::Texture& texture, sf::Vector2f velocity, uint32_t lifetime_ms, float rotation_velocity, ParticlePropertyVector properties); virtual void Update(const float& delta_time) override; virtual void Render(sf::RenderTarget* target) override; sf::Sprite& GetSprite(); const sf::Time GetAge() const; sf::Sprite sprite; sf::Vector2f velocity; uint32_t lifetime_ms; float rotation_velocity; ParticlePropertyVector properties; private: sf::Clock age_clock; }; } } #endif //SIMPLEENGINE_PARTICLE_H