#pragma once

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ResourceWindow.h : header file
//
#include "TagListDlg.h"
#include "ObjWindow.h"
#include "EditorChildWnd.h"
#include <Adept\Entity.hpp>
#include <MW4\Mech_ai.hpp>
#include "EditWnd.h"

/////////////////////////////////////////////////////////////////////////////
// CInstanceWindow frame

class CInstanceWindow  : public CEditorChildWnd
{
friend class CTagListDlg;
	DECLARE_DYNCREATE(CInstanceWindow)
protected:
	void
		AddInstance(Adept::Entity* entity, bool fill = true);

// Attributes
public:

// Operations
public:
	CInstanceWindow();           // protected constructor used by dynamic creation
	virtual ~CInstanceWindow();

	Stuff::ChainOf<TabList *>
		mechList;

	Stuff::ChainOf<TabList *>
		buildingList;

	Stuff::ChainOf<TabList *>
		vehicleList;

	Stuff::ChainOf<TabList *>
		miscList;

	void
		ClearInstanceLists();
	void
		ResetInstanceLists();
	void
		RemoveInstance(Adept::Entity* entity);
	void
		FillTabBox(int tab = -1);
	void
		FillTabBox(ChainIteratorOf<TabList*> &iterator);
	int
		GetSelectedObject();
	void
		ResetSel();
	void
		ObjEditScript(char* file = NULL, int line = 0);
	void
		ChangeObjName();

	void
		CheckHiddenObject(Entity* entity);

	void
		OnObjSpecifyScript(Entity* entity);

	CObjWindow
		*TLDlg;
	CEditWnd*
		scriptWnd;

	void
		OnClearAI(Entity* entity);
	void
		OnABLMemory(Entity* entity);

	void OnEditSkill(Entity* entity);

protected:
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CInstanceWindow)
	protected:
	virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
	//}}AFX_VIRTUAL

// Implementation
public:
	// Generated message map functions
	//{{AFX_MSG(CInstanceWindow)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnObjName();
	afx_msg void OnObjParameters();
	afx_msg void OnObjTranslation();
	afx_msg void OnObjRemoveinstance();
	afx_msg void OnObjGotoinstance();
	afx_msg void OnObjDamageobjArmor();
	afx_msg void OnObjDamageobjInternal();
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnObjEditDriver();
	afx_msg void OnObjEditObjective();
	afx_msg void OnObjSpecifyScript();
	afx_msg void OnObjEditScript();
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg void OnObjAlignment();
	afx_msg void OnEditLight();
	afx_msg void OnClearAI();
	afx_msg void OnABLMemory();
	afx_msg void OnEditSkill();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
