/* $Id: skwoermzone.hpp,v 1.5.2.1 2006/01/20 11:33:53 chfreund Exp $ */ #ifndef _SKWOERMZONE_HPP_ #define _SKWOERMZONE_HPP_ #include #include "serializable.hpp" #include "vector.hpp" #include "attachableobject.hpp" class SkwoermZone : public AttachableObject { public: typedef enum {ALIVE, DECAYING} SZState; private: //! The radius of the area real m_radius; //! The length of the outer decay part of the radius real m_decayRadius; //! The timestep value at the center real m_dt; real m_currentDt; SZState m_szState; public: SkwoermZone( void ) {} // only used for deserialization SkwoermZone( AttachableObject* object, real dt = 0.1 ); SkwoermZone( const Vector& position, real dt = 0.1 ); ~SkwoermZone( void ); Sint32 getID( void ) const { return 666; /* Is that a good idea? Tom */} void update( void ); bool performFlying( void ) { return true; } void setRadii( const real radius, const real decayRadius ); real getRadius( void ) const { return m_radius; } real getDecayRadius( void ) const { return m_decayRadius; } void setDT( const real dt ) { m_dt = dt; } real getDT( const Vector& point ) const; bool containsPoint( const Vector& point ) const { return (point-m_pos).abs2() <= m_radius*m_radius; } bool isAlive( void ) const { return m_szState == ALIVE; } void keepAlive( void ) { m_szState = ALIVE; } void serialize( Uint8*& bufferPointer ) const; void deserialize( Uint8*& bufferPointer ); Uint32 getSerializeBufferSize( void ) const; }; #endif // _SKWOERMZONE_HPP_