+/**
+ * Class doing particle as well as their spawners handling
+ */
+class ParticleManager
+{
+friend class ParticleSpawner;
+public:
+ ParticleManager(ClientEnvironment* env);
+ ~ParticleManager();
+
+ void step (float dtime);
+
+ void handleParticleEvent(ClientEvent *event, Client *client,
+ LocalPlayer *player);
+
+ void addDiggingParticles(IGameDef *gamedef, LocalPlayer *player, v3s16 pos,
+ const MapNode &n, const ContentFeatures &f);
+
+ void addPunchingParticles(IGameDef *gamedef, LocalPlayer *player, v3s16 pos,
+ const MapNode &n, const ContentFeatures &f);
+
+ void addNodeParticle(IGameDef *gamedef, LocalPlayer *player, v3s16 pos,
+ const MapNode &n, const ContentFeatures &f);
+
+protected:
+ void addParticle(Particle* toadd);
+
+private:
+
+ void stepParticles (float dtime);
+ void stepSpawners (float dtime);
+
+ void clearAll ();
+
+ std::vector<Particle*> m_particles;
+ std::map<u32, ParticleSpawner*> m_particle_spawners;
+
+ ClientEnvironment* m_env;
+ std::mutex m_particle_list_lock;
+ std::mutex m_spawner_list_lock;
+};