43 virtual void Draw(SpriteBatch *pSpriteBatch);
56 m_projectileIt = m_projectiles.begin();
57 for (; m_projectileIt != m_projectiles.end(); m_projectileIt++)
60 if (!pProjectile->
IsActive())
return pProjectile;
67 m_projectiles.push_back(pT);
80 std::vector<Projectile *> m_projectiles;
81 std::vector<Projectile *>::iterator m_projectileIt;
Used to recycle projectiles.
Definition: ProjectilePool.h:20
Base class for all shooter levels.
Definition: Level.h:21
virtual void AddGameObject(GameObject *pGameObject)
Adds a game object so it can be managed by the level.
Definition: Level.h:50
Shooter Library is a library of classes, interfaces, and value types that provides a foundation for d...
Definition: Background.h:16
Projectile * GetInactiveProjectile()
Get the next available projectile.
Definition: ProjectilePool.h:54
Base class for all projectile types.
Definition: Projectile.h:20
ProjectilePool(Level *pLevel, bool expands=true)
Instantiate a projectile pool object.
Definition: ProjectilePool.h:29
void Add(Projectile *pProjectile)
Add a projectile to the pool.
Definition: ProjectilePool.cpp:17
virtual bool IsActive() const
Determines if the game object is active.
Definition: GameObject.h:68
virtual void Draw(SpriteBatch *pSpriteBatch)
Renders all of the projectiles in the pool.
Definition: ProjectilePool.cpp:7