// EdScript.h: interface for the EdScript class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_EDSCRIPT_H__A724A867_2D14_4382_B5D4_55C8125F024F__INCLUDED_)
#define AFX_EDSCRIPT_H__A724A867_2D14_4382_B5D4_55C8125F024F__INCLUDED_

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

class ScriptField
{
protected:
CString Name,Tag,Value;
int IntData;
float FloatData;
enum DataType {FUNDEF,INTDATA,TEXTDATA,STATICTEXT,FLOATDATA};
DataType Type;
public:
ScriptField() {Type=FUNDEF;}

bool GetDefaultValue(CString script);
void SetData(CString nme,CString tg,CString val) {Name=nme; Tag=tg; Value=val; Type=TEXTDATA;}
void AddDefaultValueLine(CString &str);
void SetData(CString nme)						 {Name=nme; Type=STATICTEXT;}
void SetData(CString nme,CString tg,int val);		
void SetData(CString nme,CString tg,float val);	
void InsertValue(CString *tstr);

friend class CScriptParamDlg;
};


class EdScript  
{
protected:
	ScriptField *Fields;
	int TotFields;
	CString Template;
	CString TemplateName;
	int CountFieldsIn(CString str); 
	void SetTemplate(CString str);
	void Init() { TotFields=-1; Fields=NULL;}
public:
	EdScript *Clone();
	void Copy(EdScript &scrpt);
	bool LoadTemplate(CString tempname);
	bool GetDefaultValues(CString script);
	CString GetScript();
	EdScript(CString fname);
	EdScript();
	virtual ~EdScript();
	CString GetTemplateName() {return TemplateName;}

friend class CScriptParamDlg;
};

#endif // !defined(AFX_EDSCRIPT_H__A724A867_2D14_4382_B5D4_55C8125F024F__INCLUDED_)
