//
// Asura_Chunk_Attractors.h
//
// Created by JGP 03/05/06
// 
// Copyright (C) 2006 Rebellion (Derby), All Rights Reserved.
//

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifndef __ASURA_CHUNK_ATTRACTORS_H__
#define __ASURA_CHUNK_ATTRACTORS_H__

// Asura headers
#include "ChunkSystem/Asura_Chunk_Loaders.h"

// Forward defines
class Asura_Chunk_Stream;
class Asura_SaveBlock_Base;


/*
	Asura_Chunk_Attractors

	Chunk for creating the
	Asura_Attractor_System
	with a tree and a number
	of Asura_Attractor_Compiled
	objects.
*/
class Asura_Chunk_Attractors : public Asura_Chunk_Header
{

	public:
		bool Process( Asura_Handle xFileHandle ) const;
#ifdef ASURA_TOOLS
		static const bool Create( Asura_Chunk_Stream& xStream );
#endif

	enum
	{
		CHUNK_VERSION = 6,
	};

};


#ifdef ASURA_TOOLS

/*
	Asura_Chunk_Tools_Attractors

	Chunk define for the 
	Tools_Attractor_System
*/
class Asura_Chunk_Tools_Attractors : public Asura_Chunk_Header
{

	public:
		bool Process( Asura_Handle xFileHandle ) const;
		static void Create( Asura_SaveBlock* pxSaveBlock, bool bMissionFile);

		//Imports a single attractor (for templates). The imported attractor and nodes will be assigned new IDs
		class Tools_Attractor* ImportFromChunkBuffer(const char* pcChunkBuffer,u_int uIDToImport) const;

	private :
		bool Process( Asura_Chunk_Stream& xStream, u_int uIDToImport, class Tools_Attractor** ppxOutputAttractor ) const;


	enum
	{
		CHUNK_VERSION = 8,
	};

};
#endif

//Stores the ingame state of the attractors.
//Currently just the flags for the active/inactive status
class Asura_Chunk_Attractors_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);

	enum
	{
		CHUNK_VERSION = 0,
	};
};



#endif//__ASURA_CHUNK_ATTRACTORS_H__
