/* $Id: noncollidablepool.hpp,v 1.5 2005/10/14 14:17:20 pohlt Exp $ */ #ifndef _NON_COLLIDABLE_POOL_HPP_ #define _NON_COLLIDABLE_POOL_HPP_ /**********************************************************/ #include "pool.hpp" #include "explosion.hpp" #include "smoke.hpp" /**********************************************************/ class NonCollidablePool : public Serializable { public: NonCollidablePool( World* wp ); ~NonCollidablePool(); bool isGeneratedByThisPool( const Sint32 objectID ) { return (objectID >= SMALLEST_EXPLOSION && objectID <= BIGGEST_EXPLOSION ) || (objectID >= SMALLEST_SMOKE && objectID <= BIGGEST_SMOKE ); } //! bool removeObject( const Object* const object ); //! returns pointer to a new explosion object Explosion* newExplosion( const Sint32 size ) { Explosion *const explosion = m_ExplosionPool.newItem(); explosion->m_worldPointer = m_world; explosion->setSize( size ); explosion->setRemoveMeAfterUpdate( false ); return explosion; } //! returns pointer to a new smoke object Smoke* newSmoke( const Sint32 size ) { Smoke *const smoke = m_SmokePool.newItem(); smoke->m_worldPointer = m_world; smoke->setColor( 0x00ffffff ); smoke->setSize( size ); smoke->setRemoveMeAfterUpdate( false ); return smoke; } //! resets the object to the state after its creation void reset(); //////////////////////////////////////////////////// //! \name (de)serialization //@{ virtual Uint32 getSerializeBufferSize() const; virtual void serialize( Uint8*& bufferPointer ) const; virtual void deserialize( Uint8*& bufferPointer ); //@} protected: World* m_world; Pool m_ExplosionPool; Pool m_SmokePool; }; /**********************************************************/ #endif // _NON_COLLIDABLE_POOL_HPP_