#ifdef ASURA_USE_AXON
//////////////////////////////////////////////////////////////////////////////
//
// Axon_Sense_Hearing.h
//
// Created by NJD - 31 August 2006
//
// Copyright (C) 2006 Rebellion, All Rights Reserved.
//
//////////////////////////////////////////////////////////////////////////////

// B E G I N   F I L E   W R A P P E R ///////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifndef __AXON_SENSE_HEARING_H__
#define __AXON_SENSE_HEARING_H__ 1

// E N D   F I L E   W R A P P E R ///////////////////////////////////////////

// I N C L U D E S ///////////////////////////////////////////////////////////

// axon
#include "Core/Axon_Sound_Registry.h"
#include "Knowledge/Axon_Sense.h"

// F O R W A R D   D E C L A R A T I O N S ///////////////////////////////////

template< typename T > class Asura_List;
class Asura_Blueprint;
class Asura_Chunk_Stream;
class Asura_Message;
struct Axon_Knowledge;

//////////////////////////////////////////////////////////////////////////////
//
// Axon_Sense_Hearing
//
//////////////////////////////////////////////////////////////////////////////

class Axon_Sense_Hearing : public Axon_Sense< Axon_Knowledge >
{
public:
    Axon_Sense_Hearing( Axon_Knowledge_System< Axon_Knowledge >* pxKnowledgeSystem );
    virtual ~Axon_Sense_Hearing();
    virtual void InitialiseFromBlueprint( const Asura_Blueprint& xBlueprint ) {}
    virtual void ReadFromChunkStream( Asura_Chunk_Stream& xStream );
    virtual void WriteToChunkStream( Asura_Chunk_Stream& xStream ) const;
    virtual void Update( const float fTimeslice );
    virtual bool HandleMessage( const Asura_Message* pxMessage );

    const Asura_List< Axon_Knowledge >* GetList() const { return &m_xSoundList; }

protected:
    virtual bool ShouldCullSound( const Axon_Sound_Registry::SoundEntry* pxEntry );
    void         DestroyAllKnowledge();

protected:
    float                        m_fSensitivity;
    float                        m_fModifier;
    Asura_List< Axon_Knowledge > m_xSoundList;

private:
    struct ChunkData
    {
        enum { CURRENT_VERSION = 0 };
        float m_fModifier;
    };
};

//////////////////////////////////////////////////////////////////////////////
//
// 
//
//////////////////////////////////////////////////////////////////////////////

#endif //__AXON_SENSE_HEARING_H__
#endif
