Building the particle system class
With all of the building blocks in place, it's time to actually build the particle system class. Let's start with some type definitions:
using Updaters = std::unordered_map<std::string, std::unique_ptr<BaseUpdater>>; using EmitterList = std::vector<std::unique_ptr<Emitter>>; using Emitters = std::unordered_map<StateType, EmitterList>; using GeneratorList = std::vector<std::unique_ptr<BaseGenerator>>; using Generators = std::unordered_map<std::string,GeneratorList>; using RemovedEmitters = std::vector<Emitter*>; using Particles = std::unordered_map<StateType, std::unique_ptr<ParticleContainer>>; using ForceApplicatorList = std::vector<ForceApplicator>; using ForceApplicators = std::unordered_map<StateType, ForceApplicatorList>; using GeneratorFactory = std::unordered_map<std::string, std::function<BaseGenerator*(void)>>;
In order to...