Space Fighter
A "shmup" game for Computer Programming C++
Loading...
Searching...
No Matches
ParticlePool.h
Go to the documentation of this file.
1
2/*
3 ██╗ ██╗ █████╗ ████████╗ █████╗ ███╗ ██╗ █████╗
4 ██║ ██╔╝ ██╔══██╗ ╚══██╔══╝ ██╔══██╗ ████╗ ██║ ██╔══██╗
5 █████╔╝ ███████║ ██║ ███████║ ██╔██╗ ██║ ███████║
6 ██╔═██╗ ██╔══██║ ██║ ██╔══██║ ██║╚██╗██║ ██╔══██║
7 ██║ ██╗ ██║ ██║ ██║ ██║ ██║ ██║ ╚████║ ██║ ██║
8 ╚═╝ ╚═╝ ╚═╝ ╚═╝/\ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝
9 /vvvvvvvvvvvvvvvvvvv \=========================================,
10 `^^^^^^^^^^^^^^^^^^^ /---------------------------------------"
11 Katana Engine \/ © 2012 - Shuriken Studios LLC
12 http://www.shurikenstudios.com
13*/
14
15#pragma once
16
17#include "KatanaEngine.h"
18
19
20namespace KatanaEngine
21{
22
25 {
26
27 public:
28
30 ParticlePool(IParticleUpdater* pUpdater, IParticleRenderer* pRenderer);
31 virtual ~ParticlePool();
32
33 virtual void Update(const GameTime& gameTime);
34
35 virtual void Draw(SpriteBatch& spriteBatch);
36
38
39 virtual void AddParticle(IParticle *pParticle) { m_particles.push_back(pParticle); }
40
41 private:
42
43 std::vector<IParticle *> m_particles;
44 std::vector<IParticle *>::iterator m_particlesIt;
45
46 IParticleUpdater* m_pUpdater = nullptr;
47 IParticleRenderer* m_pRenderer = nullptr;
48
49 };
50
51}
Contains timing values for game updates and rendering.
Definition GameTime.h:21
Interface for a particle.
Definition IParticle.h:24
Interface for a particle renderer.
Interface for a particle updater.
Class that manages a pool of particles.
virtual void Update(const GameTime &gameTime)
ParticlePool(IParticleUpdater *pUpdater, IParticleRenderer *pRenderer)
Creates a new instance of ParticlePool.
virtual void AddParticle(IParticle *pParticle)
virtual IParticle * GetInactiveParticle()
virtual void Draw(SpriteBatch &spriteBatch)
Enables a group of sprites to be drawn using the same settings.
Definition SpriteBatch.h:48
Katana Engine is a library of classes, interfaces, and value types that provides a foundation for dev...
Definition Animation.cpp:18