//
// Tools_Botanicals_Styles.h
//
// Created by Dave Reed - 17/11/2005
// 
// Copyright (C) 2005 Rebellion (Derby), All Rights Reserved.
//

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifdef ASURA_USE_BOTANICALS

#ifndef __TOOLS_BOTANICALS_STYLES_H__
#define __TOOLS_BOTANICALS_STYLES_H__

#define TOOLS_BOTANICALS_ENTRIES_PER_STYLE 6

#include "Core/Asura_Maths.h"

// A 'style entry' is a selected template within a style.
// The max number of these per style is TOOLS_BOTANICALS_ENTRIES_PER_STYLE 
struct Tools_Botanicals_StyleEntry
{
	int   iTemplateIdx;
	int   iTemplateUID;
	float fWeight;
};


struct Tools_Botanicals_Style
{
	Asura_String						xStyleName;
	Tools_Botanicals_StyleEntry		    axEntries[TOOLS_BOTANICALS_ENTRIES_PER_STYLE];	
};


class Tools_Botanicals_StyleManager
{
public:
	static void							Reset();
	static void							Shutdown();
	static void                         LoadStyles();
	static void							SaveStyles();	

	static Tools_Botanicals_Style*		AddStyle();	
	static void							RemoveStyle(int iIndex);
	static void							RemapStyles();		// When the templates have changed, this updated the indices from their UIDs

	static int							GetNumStyles();
	static Tools_Botanicals_Style*		GetStyle(int iIndex);
	static char*						GetStyleName(int iIndex);

	static void                         OpenEditStyleOverlay(int iStyleIdx);
	static void							CloseEditStyleOverlay(void);
	static bool							UpdateEditing(void);

	static void							SelectTemplate(int i);

	static int						    GetRandomTemplate(int iStyle);
private:
	static int							s_iNumStyles;
	static int							s_iStyleBeingEdited;
	static Tools_Botanicals_Style*		s_pxStyles;

	static Asura_String					s_xStyleNameString;
	static bool							s_bEditStyleOverlayVisible;
	static Asura_Vector_2				s_xEditStyleOverlayPosition;
	static char							s_aszTemplateNames[TOOLS_BOTANICALS_ENTRIES_PER_STYLE][32];
};

#endif //__TOOLS_MODE_BOTANICALS_H__
#endif //ASURA_USE_BOTANICALS
