#ifndef _TPG_OSYS_HPP_
#define _TPG_OSYS_HPP_


#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "ACP_Base.h"
#include "ITF.h"
#include "PRT.h"
#include "CTL.h"


class CPA_PartGen_MyDocument;
////////////////////////////////////////////////
// System Class

#define TPG_C_tdxDefaultParticlesNumber 100

class CPA_PartGen_System : public CPA_SaveObject
{
public:
	CPA_PartGen_System(CString, long _lNbParticles );
	CPA_PartGen_System(CString, PRT_tdstParticlesSystem *_p_stSystem = NULL, BOOL _bIsLoaded = TRUE );
	~CPA_PartGen_System();

	//virtual functions
	virtual long GetDataType(void);
	virtual void *GetData(void);
	virtual CString fn_csComputeReferencedSectionName(const CString _csNewName);

	static void m_s_fn_vCallBackSaveSystem
		( 
			SCR_tdst_File_Description *_p_stFile,
			char *_p_szSectionName,
			void *_p_vData,
			SCR_tde_Ntfy_Action _eAction 
		);

	BOOL m_pub_fn_vLoadIfUnloaded();

	PRT_tdstParticlesSystem * m_pub_fn_p_stGetSystem() {return m_pri_p_stSystem;}
	void m_pub_fn_vSetSystem( PRT_tdstParticlesSystem* );

	GMT_tdxHandleToGameMaterial m_pub_fn_hGetPriGameMaterial() {return m_pri_hGameMaterial;}
	ACP_tdxHandleOfSprite m_pub_fn_hGetPriSprite() {return m_pri_hSprite;}

	long m_pub_fn_lGetParticlesType();
	void m_pub_fn_vSetObjectPoint( GMT_tdxHandleToGameMaterial );
	GMT_tdxHandleToGameMaterial m_pub_fn_hGetPointGameMaterial();
	void m_pub_fn_vSetObjectSegment( GMT_tdxHandleToGameMaterial );
	GMT_tdxHandleToGameMaterial m_pub_fn_hGetSegmentGameMaterial();
	void m_pub_fn_vSetObjectSprite( ACP_tdxHandleOfSprite );
	ACP_tdxHandleOfSprite m_pub_fn_hGetSprite();

	CString m_pub_fn_csGetObjectName();

	long m_pub_fn_lGetNbParticles();

	CPA_PartGen_MyDocument * m_pub_fn_p_clGetDocument();

public:
	CTL_Editor_DataList m_pub_clDataList;

private:
	PRT_tdstParticlesSystem *m_pri_p_stSystem;

	GMT_tdxHandleToGameMaterial m_pri_hGameMaterial;
	ACP_tdxHandleOfSprite m_pri_hSprite;

private:
	void m_pri_fn_vFillDataList();
	void m_pri_fn_vSaveSystem( SCR_tdst_File_Description* );
	void m_pri_fn_vSetInternalParticle();
};

#endif //_TPG_OSYS_HPP_
