O'Reilly logo

Mastering SFML Game Development by Raimondas Pupius

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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>; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required