osb/source/game/StarParticleManager.hpp
2024-02-25 15:46:47 +01:00

41 lines
923 B
C++

#pragma once
#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;
};
}