//////////////////////////////////////////////////////////////////////////////
//
// AVP_WeaponData_System.h
//
// Copyright (C) 2008 Rebellion. All Rights Reserved.
//
//////////////////////////////////////////////////////////////////////////////

// B E G I N   F I L E   W R A P P E R ///////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifndef __AVP_WEAPONDATA_SYSTEM_H__
#define __AVP_WEAPONDATA_SYSTEM_H__ 1

// E N D   F I L E   W R A P P E R ///////////////////////////////////////////

#define uAVP_MAX_WEAPONS_PER_CHARACTERTYPE 16
#define uAVP_MAX_WEAPON_FILENAME_LENGTH 256
#define uAVP_MAX_WEAPONS_IN_LEVEL 10

#include "Core/AVP_Game_Core.h"
#include "Blueprint/Asura_Blueprint_System.h"

class AVP_WeaponData_System
{
public:
	static const char* GetWeaponNameFromHash( const Asura_Hash_ID uWeaponHash, const AVP_Game_Core::CharacterType eCharType );
	static const char* GetWeaponNameFromIndex( const u_int uWeaponIdx, const AVP_Game_Core::CharacterType eCharType );
	static u_int GetWeaponIndexFromHash( const Asura_Hash_ID uWeaponHash, const AVP_Game_Core::CharacterType eCharType );
	static u_int GetNumWeaponsForCharacterType( const AVP_Game_Core::CharacterType eCharType );

	static void SetShouldLoadWeapon( const u_int uWeaponIdx, const AVP_Game_Core::CharacterType eCharType, const bool bSet = true );
	static bool GetShouldLoadWeapon( const u_int uWeaponIdx, const AVP_Game_Core::CharacterType eCharType );
	static void ResetShouldBeLoadedData( const bool bSet = false );

#ifdef ASURA_TOOLS
	static void InitialiseFromBlueprints();
	static bool* GetShouldLoadWeaponBoolPtr( const u_int uWeaponIdx, const AVP_Game_Core::CharacterType eCharType );
#endif

private:

	static bool s_bLoaded;
	static u_int s_auNumWeapons[AVP_Game_Core::NUM_CHARACTERTYPES];
	static char s_aaszWeaponNames[AVP_Game_Core::NUM_CHARACTERTYPES][ uAVP_MAX_WEAPONS_PER_CHARACTERTYPE ][ uAVP_MAX_WEAPON_FILENAME_LENGTH ];
	static bool s_aabWeaponShouldBeLoaded[AVP_Game_Core::NUM_CHARACTERTYPES][ uAVP_MAX_WEAPONS_PER_CHARACTERTYPE ];

	friend class AVP_Chunk_WeaponData;
};

class AVP_Blueprint_ParameterEnumerator_LevelWeapons : public Asura_Blueprint_ParameterEnumerator
{
public:
	AVP_Blueprint_ParameterEnumerator_LevelWeapons( Asura_Hash_ID* auWeaponHashes ) : m_auWeaponHashes( auWeaponHashes ) {}

	virtual void BeginEnumeration() {}
	virtual bool Enumerate(const u_int uIndex, char const* const szName, const Asura_Value& xValue);
	virtual void EndEnumeration(const bool bSuccess) {}

private:
	Asura_Hash_ID*	m_auWeaponHashes;
	typedef Asura_Blueprint_ParameterEnumerator PARENT;
};

#endif // #ifndef __AVP_WEAPONDATA_SYSTEM_H__
