Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarParticleManager.hpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
commit6352e8e3196f78388b6c771073f9e03eaa612673 (patch)
treee23772f79a7fbc41bc9108951e9e136857484bf4 /source/game/StarParticleManager.hpp
parent6741a057e5639280d85d0f88ba26f000baa58f61 (diff)
everything everywhere
all at once
Diffstat (limited to 'source/game/StarParticleManager.hpp')
-rw-r--r--source/game/StarParticleManager.hpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/source/game/StarParticleManager.hpp b/source/game/StarParticleManager.hpp
new file mode 100644
index 0000000..d18f1d2
--- /dev/null
+++ b/source/game/StarParticleManager.hpp
@@ -0,0 +1,43 @@
+#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