osb/source/game/StarParticleManager.hpp
2023-06-20 14:33:09 +10:00

44 lines
986 B
C++

#ifndef STAR_PARTICLE_MANAGER_HPP
#define STAR_PARTICLE_MANAGER_HPP
#include "StarWorldGeometry.hpp"
#include "StarParticle.hpp"
#include "StarWorldTiles.hpp"
namespace Star {
STAR_CLASS(ParticleManager);
class ParticleManager {
public:
ParticleManager(WorldGeometry const& worldGeometry, ClientTileSectorArrayPtr const& tileSectorArray);
void add(Particle particle);
void addParticles(List<Particle> particles);
size_t count() const;
void clear();
void setUndergroundLevel(float undergroundLevel);
// Updates current particles and spawns new weather particles
void update(float dt, RectF const& cullRegion, float wind);
List<Particle> const& particles() const;
List<pair<Vec2F, Vec3B>> lightSources() const;
private:
enum class TileType { Colliding, Water, Empty };
List<Particle> m_particles;
List<Particle> m_nextParticles;
WorldGeometry m_worldGeometry;
float m_undergroundLevel;
ClientTileSectorArrayPtr m_tileSectorArray;
};
}
#endif