//
// Asura_Chunk_Dialogue.h
//
// Created by Richard Rice - 02/11/2006
// 
// Copyright (C) 2006 Rebellion, All Rights Reserved.
//

#ifndef __ASURA_CHUNK_DIALOGUE__
#define __ASURA_CHUNK_DIALOGUE__
#ifdef ASURA_USE_DIALOGUE_SYSTEM

#include "ChunkSystem/Asura_Chunk_Loaders.h"
#include "Core/Asura_Hash.h"

class Asura_Dialogue_Event;
class Asura_Dialogue_Line;
class Asura_Dialogue_Line_Template;
class Asura_Chunk_Stream;
class Asura_SaveBlock;
class Asura_SaveBlock_Base;

 
class Asura_Chunk_Dialogue_Event : public Asura_Chunk_Header
{
public :
	bool Process(class Asura_Chunk_Stream& xStream) const;
	bool Process(Asura_Handle iFileHandle) const;
#ifdef ASURA_TOOLS
	static void Create(const Asura_Dialogue_Event* pxEvent,Asura_Chunk_Stream& xStream);
	static void Create(const Asura_Dialogue_Event* pxEvent,Asura_SaveBlock* pxSaveBlock);
#endif


};

class Asura_Chunk_Dialogue_Line : public Asura_Chunk_Header
{
public :
	bool Process(class Asura_Chunk_Stream& xStream) const;
	bool Process(Asura_Handle iFileHandle) const;
#ifdef ASURA_TOOLS
	static void Create(const Asura_Dialogue_Line* pxLine,int iLanguage,Asura_Chunk_Stream& xStream);
	static void Create(const Asura_Dialogue_Line* pxLine,int iLanguage,Asura_SaveBlock* pxSaveBlock);
#endif


};

class Asura_Chunk_Dialogue_Line_Template : public Asura_Chunk_Header
{
public :
	bool Process(class Asura_Chunk_Stream& xStream) const;
	bool Process(Asura_Handle iFileHandle) const;
#ifdef ASURA_TOOLS
	static void Create(const Asura_Dialogue_Line_Template* pxTemplate,Asura_Chunk_Stream& xStream);
	static void Create(const Asura_Dialogue_Line_Template* pxTemplate,Asura_SaveBlock* pxSaveBlock);
#endif


};

#ifdef ASURA_TOOLS
class Asura_Chunk_Dialogue_ToolsGlobalSettings : public Asura_Chunk_Header
{
public :
	bool Process(class Asura_Chunk_Stream& xStream) const;
	bool Process(Asura_Handle iFileHandle) const;

	static void Create(class Asura_Chunk_Stream& xStream);
	static void Create(class Asura_SaveBlock* pxSaveBlock);

};

#endif //ASURA_TOOLS

#ifdef ASURA_TOOLS
class Asura_Chunk_Dialogue_ToolsHashToPath : public Asura_Chunk_Header
{
public :
	bool Process(class Asura_Chunk_Stream& xStream) const;
	bool Process(Asura_Handle iFileHandle) const;

	static void Create(class Asura_Chunk_Stream& xStream);
	static void Create(class Asura_SaveBlock* pxSaveBlock);

};

#endif //ASURA_TOOLS



class Asura_Chunk_Dialogue_InGame : public Asura_Chunk_Header
{
public :
	bool Process(class Asura_Chunk_Stream& xStream) const;
	bool Process(const char* pcChunkBuffer) const;

	static void Create(Asura_Chunk_Stream& xStream);
	static void Create(Asura_SaveBlock_Base* pxSaveBlock);

private :
	static bool CountEventsToSaveCallback(Asura_Hash_ID uHash,Asura_Dialogue_Event* pxEvent,void* pCount);
	static bool SaveEventCallback(Asura_Hash_ID uHash,Asura_Dialogue_Event* pxEvent,void* pStream);
};



#endif //ASURA_USE_DIALOGUE_SYSTEM
#endif //__ASURA_CHUNK_DIALOGUE__

