3 #include <boost/range/adaptor/map.hpp>
5 #include "engine/component.h"
6 #include "engine/system.h"
7 #include "engine/touchable.h"
8 #include "scripting/luabind.h"
9 #include "engine/typedefs.h"
10 #include "microbe_stage/compound.h"
12 #include <luabind/object.hpp>
14 #include <OgreCommon.h>
16 #include <OgreVector3.h>
17 #include <unordered_set>
22 using BoostCompoundMapIterator = boost::range_detail::select_second_mutable_range<std::unordered_map<std::string, CompoundId>>;
23 using BoostAbsorbedMapIterator = boost::range_detail::select_first_range<std::unordered_map<CompoundId, float>>;
29 COMPONENT(CompoundEmitter)
100 CompoundId compoundId,
117 std::vector<std::tuple<CompoundId, double, double, double>> m_compoundEmissions;
142 static luabind::scope
196 static luabind::scope
224 void update(
int,
int)
override;
228 struct Implementation;
229 std::unique_ptr<Implementation> m_impl;
static luabind::scope luaBindings()
Lua bindings.
Definition: compound_emitter_system.cpp:147
CompoundId m_compoundId
The compound id to emit.
Definition: compound_emitter_system.h:148
Component for automatic timed compound emissions.
Definition: compound_emitter_system.h:125
StorageContainer storage() const override
Serializes the component.
Definition: compound_emitter_system.cpp:129
StorageContainer storage() const override
Serializes the component.
Definition: compound_emitter_system.cpp:78
Ogre::Real m_maxInitialSpeed
The maximum initial speed of new particles.
Definition: compound_emitter_system.h:58
void load(const StorageContainer &storage) override
Loads the component.
Definition: compound_emitter_system.cpp:116
Ogre::Degree m_maxEmissionAngle
The maximum angle at which to emit particles.
Definition: compound_emitter_system.h:70
void init(GameState *gameState) override
Initializes the system.
Definition: compound_emitter_system.cpp:177
Ogre::Degree m_minEmissionAngle
The minimum angle at which to emit particles.
Definition: compound_emitter_system.h:77
Milliseconds m_timeSinceLastEmission
For use by TimedCompoundEmitterSystem.
Definition: compound_emitter_system.h:168
Base class for components.
Definition: component.h:31
void emitCompound(CompoundId compoundId, double amount, double angle, double radius)
Emits an compound according to the set properties.
Definition: compound_emitter_system.cpp:53
A system handles one specific part of the game.
Definition: system.h:23
static luabind::scope luaBindings()
Lua bindings.
Definition: compound_emitter_system.cpp:97
Emitter for compound particles.
Definition: compound_emitter_system.h:28
Milliseconds m_particleLifetime
How long new particles will stay alive.
Definition: compound_emitter_system.h:82
Milliseconds m_emitInterval
How often new particles are spawned.
Definition: compound_emitter_system.h:163
Definition: bullet_ogre_conversion.h:6
Spawns compound particles for CompoundEmitterComponent.
Definition: compound_emitter_system.h:184
GameState * gameState() const
Returns the system's game state.
Definition: system.cpp:183
Represents a distinct set of active systems and entities.
Definition: game_state.h:41
CompoundEmitterSystem()
Constructor.
Definition: compound_emitter_system.cpp:167
Ogre::Real m_minInitialSpeed
The minimum initial speed of new particles.
Definition: compound_emitter_system.h:63
void load(const StorageContainer &storage) override
Loads the component.
Definition: compound_emitter_system.cpp:65
static luabind::scope luaBindings()
Lua bindings.
Definition: compound_emitter_system.cpp:31
Ogre::Real m_emissionRadius
How far away the particles are spawned.
Definition: compound_emitter_system.h:53
void shutdown() override
Shuts the system down.
Definition: compound_emitter_system.cpp:187
void update(int, int) override
Updates the system.
Definition: compound_emitter_system.cpp:268
uint16_t m_particlesPerEmission
The number of particles created per emission interval.
Definition: compound_emitter_system.h:153
A key-value storage for serialization.
Definition: serialization.h:36
~CompoundEmitterSystem()
Destructor.
Definition: compound_emitter_system.cpp:173
float m_potencyPerParticle
The potency new particles will receive.
Definition: compound_emitter_system.h:158