//////////////////////////////////////////////////////////////////////////////////////////
//
// FILE : Asura_ServerEntity_Actor.h
//
// Copyright (C) 2002 Rebellion, All Rights Reserved.
//
//////////////////////////////////////////////////////////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif

#ifndef __ASURA_SERVER_ENTITY_ACTOR_H__
#define __ASURA_SERVER_ENTITY_ACTOR_H__


//////////////
// INCLUDES //
//////////////
#include "Entity/PhysicalObject/Asura_ServerEntity_PhysicalObject.h"


//////////////////////////////
// Asura_ServerEntity_Actor //
//////////////////////////////
class Asura_ServerEntity_Actor : public virtual Asura_ServerEntity_PhysicalObject
{
protected:
	Asura_ServerEntity_Actor();
	virtual ~Asura_ServerEntity_Actor();

	// ChunkData
	struct ChunkData
	{
		enum {CURRENT_VERSION = 0};
		int m_iVersion;
	};

public:
	virtual void Update() {}
	virtual bool HandleMessage(const Asura_Message* pxMessage) {return false;}


	virtual void FillInChunkBuffer(char*& pcChunkBuffer);
	virtual int GetChunkBufferSize() { return sizeof(ChunkData); }
	// override this in your NPC class to get sent messages when a sound is triggered.
	virtual void HearSound(const class Asura_AI_SoundForAI* pxSoundData) {}

protected:
	virtual void InitialiseFromChunkBuffer(const char*& pcChunkBuffer);

public:
	static Asura_ServerEntity_Actor* FindEntity(Asura_Guid uGuid)
	{
		return s_xList.FindEntity(uGuid);
	}
	static const Asura_Hashed_List<Asura_ServerEntity_Actor>* GetList()
	{
		return &s_xList;
	}

private:

	// List of all asura server physical objects
	static Asura_Hashed_List<Asura_ServerEntity_Actor> s_xList;
};


//////////////
// MESSAGES //
//////////////
class Asura_Message_Actor_ClientUpdate : public Asura_Message_PhysicalObject_ClientUpdate
{
public:
	// Add any extra data needed here...

    void FillActor(const Asura_ServerEntity_Actor* pxObject)
    {
        FillPhysical(pxObject);
    }
};


#endif //__ASURA_SERVER_ENTITY_ACTOR_H__
