class UIInventoryItemsManager
{
	private var m_iconsNameResolver : IconsNameResolver;
	private var m_useMaleIcons : Bool;
	private var m_ammoTypeCache : inkIntHashMap;
	private var m_statsMapCache : inkWeakHashMap;
	private var m_statsPropertiesCache : inkHashMap;
	private var m_player : weak< PlayerPuppet >;
	private var m_transactionSystem : TransactionSystem;
	private var m_statsDataSystem : StatsDataSystem;
	private var m_uiScriptableSystem : weak< UIScriptableSystem >;
	private var m_inventoryManager : weak< InventoryManager >;
	private var m_equippedItemsFetched : Bool;
	private var m_equippedItems : array< ItemID >;
	private var m_transmogItemsFetched : Bool;
	private var m_transmogItems : array< ItemID >;
	private var m_maxStatValuesData : array< WeaponMaxStatValueData >;
	private var m_notSellableTags : array< CName >;
	private var m_TEMP_cuverBarsEnabled : Bool;
	private var m_TEMP_separatorBarsEnabled : Bool;

	public static function Make( player : weak< PlayerPuppet >, transactionSystem : TransactionSystem, uiScriptableSystem : weak< UIScriptableSystem > ) : UIInventoryItemsManager
	{
		var instance : UIInventoryItemsManager;
		instance = new UIInventoryItemsManager;
		instance.m_transactionSystem = transactionSystem;
		instance.m_uiScriptableSystem = uiScriptableSystem;
		instance.m_iconsNameResolver = IconsNameResolver.GetIconsNameResolver();
		instance.m_useMaleIcons = UIGenderHelper.GetIconGender( player ) == ItemIconGender.Male;
		instance.m_statsDataSystem = GameInstance.GetStatsDataSystem( player.GetGame() );
		instance.m_inventoryManager = GameInstance.GetInventoryManager( player.GetGame() );
		instance.AttachPlayer( player );
		instance.m_ammoTypeCache = new inkIntHashMap;
		instance.m_statsMapCache = new inkWeakHashMap;
		instance.m_statsPropertiesCache = new inkHashMap;
		instance.PopulatemaxStatValues();
		instance.m_notSellableTags = TweakDBInterface.GetCNameArray( T"RTDB.Vendor.customerFilterTags" );
		instance.m_notSellableTags.Remove( 'Cyberware' );
		return instance;
	}

	public function AttachPlayer( player : weak< PlayerPuppet > )
	{
		this.m_player = player;
	}

	public function GetAttachedPlayer() : weak< PlayerPuppet >
	{
		return m_player;
	}

	public function GetPlayerBufferSize() : Float
	{
		var playerBufferValue : Float;
		GameInstance.GetStatsSystem( m_player.GetGame() ).GetStatValue( m_player.GetEntityID(), gamedataStatType.BufferSize );
		return playerBufferValue;
	}

	public function GetTransactionSystem() : weak< TransactionSystem >
	{
		return m_transactionSystem;
	}

	public function GetInventoryManager() : weak< InventoryManager >
	{
		return m_inventoryManager;
	}

	public function SetCuverBarsEnabled( value : Bool )
	{
		m_TEMP_cuverBarsEnabled = value;
	}

	public function GetCurveBarsEnabled() : Bool
	{
		return m_TEMP_cuverBarsEnabled;
	}

	public function SetSeparatorBarsEnabled( value : Bool )
	{
		m_TEMP_separatorBarsEnabled = value;
	}

	public function GetSeparatorBarsEnabled() : Bool
	{
		return m_TEMP_separatorBarsEnabled;
	}

	private function PopulatemaxStatValues()
	{
		var record : WeaponsTooltipData_Record;
		var stats : array< weak< Stat_Record > >;
		var values : array< Float >;
		var i, limit : Int32;
		var element : WeaponMaxStatValueData;
		record = TweakDBInterface.GetWeaponsTooltipDataRecord( T"WeaponsTooltip.TooltipData" );
		record.StatsToCompare( stats );
		values = record.MaxStatsValue();
		for( i = 0, limit = stats.Size(); i < limit; i += 1 )
		{
			element = new WeaponMaxStatValueData;
			element.stat = stats[ i ].StatType();
			element.value = values[ i ];
			m_maxStatValuesData.PushBack( element );
		}
	}

	public function GetWeaponStatMaxValue( stat : gamedataStatType ) : Float
	{
		var i, limit : Int32;
		for( i = 0, limit = m_maxStatValuesData.Size(); i < limit; i += 1 )
		{
			if( m_maxStatValuesData[ i ].stat == stat )
			{
				return m_maxStatValuesData[ i ].value;
			}
		}
		return -1.0;
	}

	public static function ResolveItemIconName( itemTweakID : TweakDBID, itemRecord : weak< Item_Record >, manager : weak< UIInventoryItemsManager > ) : String
	{
		var result : String;
		var resolver : weak< IconsNameResolver >;
		var useMaleIcons : Bool;
		result = itemRecord.IconPath();
		if( IsStringValid( result ) )
		{
			return "UIIcon." + result;
		}
		resolver = ( ( manager ) ? ( manager.m_iconsNameResolver ) : ( IconsNameResolver.GetIconsNameResolver() ) );
		useMaleIcons = ( ( manager ) ? ( manager.m_useMaleIcons ) : ( false ) );
		result = NameToString( resolver.TranslateItemToIconName( itemTweakID, useMaleIcons ) );
		if( IsStringValid( result ) )
		{
			return "UIIcon." + result;
		}
		return result;
	}

	public static function ResolveItemIconName( itemTweakID : TweakDBID, itemRecord : weak< Item_Record >, useMaleIcon : Bool ) : String
	{
		var result : String;
		var useMaleIcons : Bool;
		result = itemRecord.IconPath();
		if( IsStringValid( result ) )
		{
			return "UIIcon." + result;
		}
		result = NameToString( IconsNameResolver.GetIconsNameResolver().TranslateItemToIconName( itemTweakID, useMaleIcons ) );
		if( IsStringValid( result ) )
		{
			return "UIIcon." + result;
		}
		return result;
	}

	public static function ResolveItemIconName( itemTweakID : TweakDBID, itemRecord : weak< Item_Record >, player : weak< PlayerPuppet > ) : String
	{
		return ResolveItemIconName( itemTweakID, itemRecord, ( ( player ) ? ( UIGenderHelper.GetIconGender( player ) == ItemIconGender.Male ) : ( false ) ) );
	}

	public function IsSellable( itemData : gameItemData ) : Bool
	{
		return UIInventoryItemsManager.IsSellableStatic( itemData, m_notSellableTags );
	}

	public static function IsSellableStatic( itemData : gameItemData ) : Bool
	{
		var tags : array< CName >;
		tags = TweakDBInterface.GetCNameArray( T"RTDB.Vendor.customerFilterTags" );
		tags.Remove( 'Cyberware' );
		return UIInventoryItemsManager.IsSellableStatic( itemData, tags );
	}

	public static function IsSellableStatic( itemData : gameItemData, filterTags : ref< array< CName > > ) : Bool
	{
		return !( itemData.HasAnyOfTags( filterTags ) );
	}

	public static function GetAmmo( itemRecord : weak< Item_Record >, optional force : Bool, manager : weak< UIInventoryItemsManager > ) : Int32
	{
		var ammoId : ItemID;
		var ammoHash : Uint64;
		var weaponRecord : WeaponItem_Record;
		var category : gamedataItemCategory;
		var ammoCount : Int32;
		if( manager && ( manager.m_player != NULL ) )
		{
			category = itemRecord.ItemCategory().Type();
			if( category == gamedataItemCategory.Weapon )
			{
				weaponRecord = ( ( WeaponItem_Record )( itemRecord ) );
				ammoId = ItemID.CreateQuery( weaponRecord.Ammo().GetID() );
				if( force )
				{
					return manager.m_transactionSystem.GetItemQuantity( manager.m_player, ammoId );
				}
				ammoHash = ItemID.GetCombinedHash( ammoId );
				ammoCount = manager.m_ammoTypeCache.Get( ammoHash );
				if( ammoCount >= 0 )
				{
					return ammoCount;
				}
				ammoCount = manager.m_transactionSystem.GetItemQuantity( manager.m_player, ammoId );
				manager.m_ammoTypeCache.Insert( ammoHash, ammoCount );
				return ammoCount;
			}
		}
		return -1;
	}

	public function FlushAmmoCache()
	{
		m_ammoTypeCache.Clear();
	}

	public static function GetUIStatsMap( itemType : gamedataItemType, optional manager : weak< UIInventoryItemsManager > ) : weak< UIStatsMap_Record >
	{
		var numericItemType : Uint64;
		var record : weak< UIStatsMap_Record >;
		numericItemType = ( ( Uint64 )( itemType ) );
		if( manager )
		{
			record = ( ( weak< weak< UIStatsMap_Record > > )( manager.m_statsMapCache.Get( numericItemType ) ) );
			if( record )
			{
				return record;
			}
		}
		record = TDB.GetUIStatsMapRecord( TDBID.Create( "UIMaps." + EnumValueToString( "gamedataItemType", ( ( Int32 )( numericItemType ) ) ) ) );
		if( manager )
		{
			manager.m_statsMapCache.Insert( numericItemType, record );
		}
		return record;
	}

	public function GetStatsSystemValueFromCurve( set : CName, curve : CName, value : Float ) : Float
	{
		return m_statsDataSystem.GetValueFromCurve( set, value, curve );
	}

	public static function GetUIStatProperties( statType : gamedataStatType, optional manager : weak< UIInventoryItemsManager > ) : UIItemStatProperties
	{
		var statId : TweakDBID;
		var instance : UIItemStatProperties;
		instance = new UIItemStatProperties;
		statId = TDBID.Create( "BaseStats." + EnumValueToString( "gamedataStatType", ( ( Int32 )( statType ) ) ) );
		instance = UIItemStatProperties.Make( TweakDBInterface.GetString( statId + T".localizedName", "" ), TweakDBInterface.GetInt( statId + T".decimalPlaces", 2 ), TweakDBInterface.GetBool( statId + T".displayPercent", false ), TweakDBInterface.GetBool( statId + T".displayPlus", false ), TweakDBInterface.GetBool( statId + T".inMeters", false ), TweakDBInterface.GetBool( statId + T".inSeconds", false ), TweakDBInterface.GetBool( statId + T".inSpeed", false ), TweakDBInterface.GetBool( statId + T".multiplyBy100InText", false ), TweakDBInterface.GetBool( statId + T".roundValue", false ), ( ( manager != NULL ) ? ( manager.GetWeaponStatMaxValue( statType ) ) : ( -1.0 ) ), TweakDBInterface.GetBool( statId + T".shouldFlipNegativeValue", false ) );
		return instance;
	}

	public static function GetUIStatProperties( statType : gamedataStatType, roundValue : Bool, optional manager : weak< UIInventoryItemsManager > ) : UIItemStatProperties
	{
		var statId : TweakDBID;
		var instance : UIItemStatProperties;
		instance = new UIItemStatProperties;
		statId = TDBID.Create( "BaseStats." + EnumValueToString( "gamedataStatType", ( ( Int32 )( statType ) ) ) );
		instance = UIItemStatProperties.Make( TweakDBInterface.GetString( statId + T".localizedName", "" ), TweakDBInterface.GetInt( statId + T".decimalPlaces", 2 ), TweakDBInterface.GetBool( statId + T".displayPercent", false ), TweakDBInterface.GetBool( statId + T".displayPlus", false ), TweakDBInterface.GetBool( statId + T".inMeters", false ), TweakDBInterface.GetBool( statId + T".inSeconds", false ), TweakDBInterface.GetBool( statId + T".inSpeed", false ), TweakDBInterface.GetBool( statId + T".multiplyBy100InText", false ), roundValue, ( ( manager != NULL ) ? ( manager.GetWeaponStatMaxValue( statType ) ) : ( -1.0 ) ), TweakDBInterface.GetBool( statId + T".shouldFlipNegativeValue", false ) );
		return instance;
	}

	public function GetCachedUIStatProperties( statType : gamedataStatType ) : weak< UIItemStatProperties >
	{
		var instance : UIItemStatProperties;
		instance = ( ( weak< weak< UIItemStatProperties > > )( m_statsPropertiesCache.Get( ( ( Uint64 )( statType ) ) ) ) );
		if( instance )
		{
			return instance;
		}
		instance = UIInventoryItemsManager.GetUIStatProperties( statType, this );
		m_statsPropertiesCache.Insert( ( ( Uint64 )( statType ) ), instance );
		return instance;
	}

	public function GetCachedUIStatProperties( statType : gamedataStatType, roundValue : Bool ) : weak< UIItemStatProperties >
	{
		var instance : UIItemStatProperties;
		instance = ( ( weak< weak< UIItemStatProperties > > )( m_statsPropertiesCache.Get( ( ( Uint64 )( statType ) ) ) ) );
		if( instance )
		{
			return instance;
		}
		instance = UIInventoryItemsManager.GetUIStatProperties( statType, roundValue, this );
		m_statsPropertiesCache.Insert( ( ( Uint64 )( statType ) ), instance );
		return instance;
	}

	public function FlushStatMaps()
	{
		m_statsMapCache.Clear();
	}

	public function GetCachedEquippedItems() : array< ItemID >
	{
		var i, j, limit, jLimit : Int32;
		var equipmentSystem : EquipmentSystem;
		var playerData : EquipmentSystemPlayerData;
		var cyberwarEquipmentAreas : array< gamedataEquipmentArea >;
		if( m_equippedItemsFetched )
		{
			return m_equippedItems;
		}
		equipmentSystem = EquipmentSystem.GetInstance( m_player );
		playerData = equipmentSystem.GetPlayerData( m_player );
		m_equippedItems.PushBack( playerData.GetItemInEquipSlot( gamedataEquipmentArea.Head, 0 ) );
		m_equippedItems.PushBack( playerData.GetItemInEquipSlot( gamedataEquipmentArea.Face, 0 ) );
		m_equippedItems.PushBack( playerData.GetItemInEquipSlot( gamedataEquipmentArea.OuterChest, 0 ) );
		m_equippedItems.PushBack( playerData.GetItemInEquipSlot( gamedataEquipmentArea.InnerChest, 0 ) );
		m_equippedItems.PushBack( playerData.GetItemInEquipSlot( gamedataEquipmentArea.Legs, 0 ) );
		m_equippedItems.PushBack( playerData.GetItemInEquipSlot( gamedataEquipmentArea.Feet, 0 ) );
		m_equippedItems.PushBack( playerData.GetItemInEquipSlot( gamedataEquipmentArea.Outfit, 0 ) );
		m_equippedItems.PushBack( playerData.GetItemInEquipSlot( gamedataEquipmentArea.Weapon, 0 ) );
		m_equippedItems.PushBack( playerData.GetItemInEquipSlot( gamedataEquipmentArea.Weapon, 1 ) );
		m_equippedItems.PushBack( playerData.GetItemInEquipSlot( gamedataEquipmentArea.Weapon, 2 ) );
		m_equippedItems.PushBack( playerData.GetActiveConsumable() );
		m_equippedItems.PushBack( playerData.GetActiveGadget() );
		cyberwarEquipmentAreas = GetCyberwarEquipmentAreas();
		for( i = 0, limit = cyberwarEquipmentAreas.Size(); i < limit; i += 1 )
		{
			for( j = 0, jLimit = playerData.GetNumberOfSlots( cyberwarEquipmentAreas[ i ], true ); j < jLimit; j += 1 )
			{
				m_equippedItems.PushBack( playerData.GetItemInEquipSlot( cyberwarEquipmentAreas[ i ], j ) );
			}
		}
		m_equippedItemsFetched = true;
		return m_equippedItems;
	}

	public function IsItemNew( item : ItemID ) : Bool
	{
		return m_uiScriptableSystem.IsInventoryItemNew( item );
	}

	public function IsItemPlayerFavourite( item : ItemID ) : Bool
	{
		return m_uiScriptableSystem.IsItemPlayerFavourite( item );
	}

	public function IsItemEquipped( itemID : ItemID ) : Bool
	{
		if( m_equippedItemsFetched )
		{
			return m_equippedItems.Contains( itemID );
		}
		GetCachedEquippedItems();
		return m_equippedItems.Contains( itemID );
	}

	public function FlushEquippedItems()
	{
		m_equippedItems.Clear();
		m_equippedItemsFetched = false;
	}

	public function GetNumberOfSlots( equipmentArea : gamedataEquipmentArea ) : Int32
	{
		return EquipmentSystem.GetInstance( m_player ).GetPlayerData( m_player ).GetNumberOfSlots( equipmentArea, true );
	}

	public function GetRawEquippedItems( equipmentArea : gamedataEquipmentArea ) : array< ItemID >
	{
		var i, limit, numberOfSlots : Int32;
		var equipmentSystem : EquipmentSystem;
		var playerData : EquipmentSystemPlayerData;
		var result : array< ItemID >;
		equipmentSystem = EquipmentSystem.GetInstance( m_player );
		playerData = equipmentSystem.GetPlayerData( m_player );
		if( equipmentArea == gamedataEquipmentArea.Consumable )
		{
			result.PushBack( equipmentSystem.GetItemIDFromHotkey( m_player, EHotkey.DPAD_UP ) );
			return result;
		}
		numberOfSlots = playerData.GetNumberOfSlots( equipmentArea, true );
		for( i = 0, limit = numberOfSlots; i < limit; i += 1 )
		{
			result.PushBack( playerData.GetItemInEquipSlot( equipmentArea, i ) );
		}
		return result;
	}

	private function AddTransmogIfNotEmpty( itemID : ItemID )
	{
		if( ItemID.IsValid( itemID ) )
		{
			m_transmogItems.PushBack( itemID );
		}
	}

	public function GetCachedTransmogItems() : array< ItemID >
	{
		var equipmentSystem : EquipmentSystem;
		var playerData : EquipmentSystemPlayerData;
		if( m_transmogItemsFetched )
		{
			return m_transmogItems;
		}
		equipmentSystem = EquipmentSystem.GetInstance( m_player );
		playerData = equipmentSystem.GetPlayerData( m_player );
		AddTransmogIfNotEmpty( playerData.GetSlotOverridenVisualItem( gamedataEquipmentArea.Head ) );
		AddTransmogIfNotEmpty( playerData.GetSlotOverridenVisualItem( gamedataEquipmentArea.Face ) );
		AddTransmogIfNotEmpty( playerData.GetSlotOverridenVisualItem( gamedataEquipmentArea.OuterChest ) );
		AddTransmogIfNotEmpty( playerData.GetSlotOverridenVisualItem( gamedataEquipmentArea.InnerChest ) );
		AddTransmogIfNotEmpty( playerData.GetSlotOverridenVisualItem( gamedataEquipmentArea.Legs ) );
		AddTransmogIfNotEmpty( playerData.GetSlotOverridenVisualItem( gamedataEquipmentArea.Feet ) );
		m_transmogItemsFetched = true;
		return m_transmogItems;
	}

	public function IsItemTransmog( itemID : ItemID ) : Bool
	{
		if( m_transmogItemsFetched )
		{
			return m_transmogItems.Contains( itemID );
		}
		GetCachedTransmogItems();
		return m_transmogItems.Contains( itemID );
	}

	public function FlushTransmogItems()
	{
		m_transmogItems.Clear();
		m_transmogItemsFetched = false;
	}

	public static function IsItemTypeWeapon( itemType : gamedataItemType ) : Bool
	{
		return UIInventoryItemsManager.GetItemTypeWeapon( itemType ) != WeaponType.Invalid;
	}

	public static function GetItemTypeWeapon( itemType : gamedataItemType ) : WeaponType
	{
		if( UIInventoryItemsManager.IsItemTypeRangedWeapon( itemType ) )
		{
			return WeaponType.Ranged;
		}
		if( UIInventoryItemsManager.IsItemTypeMeleeWeapon( itemType ) )
		{
			return WeaponType.Melee;
		}
		return WeaponType.Invalid;
	}

	public static function GetBlacklistedTags() : array< CName >
	{
		var tags : array< CName >;
		tags.PushBack( 'SoftwareShsard' );
		tags.PushBack( 'TppHead' );
		tags.PushBack( 'HideInUI' );
		tags.PushBack( 'Currency' );
		tags.PushBack( 'Ammo' );
		tags.PushBack( 'base_fists' );
		return tags;
	}

	public static function GetStashBlacklistedTags() : array< CName >
	{
		var tags : array< CName >;
		tags.PushBack( 'HideInBackpackUI' );
		tags.PushBack( 'Grenade' );
		tags.PushBack( 'Inhaler' );
		tags.PushBack( 'Injector' );
		return tags;
	}

	public static function GetCyberwarEquipmentAreas() : array< gamedataEquipmentArea >
	{
		var result : array< gamedataEquipmentArea >;
		result.PushBack( gamedataEquipmentArea.FrontalCortexCW );
		result.PushBack( gamedataEquipmentArea.SystemReplacementCW );
		result.PushBack( gamedataEquipmentArea.ArmsCW );
		result.PushBack( gamedataEquipmentArea.EyesCW );
		result.PushBack( gamedataEquipmentArea.MusculoskeletalSystemCW );
		result.PushBack( gamedataEquipmentArea.HandsCW );
		result.PushBack( gamedataEquipmentArea.NervousSystemCW );
		result.PushBack( gamedataEquipmentArea.CardiovascularSystemCW );
		result.PushBack( gamedataEquipmentArea.IntegumentarySystemCW );
		result.PushBack( gamedataEquipmentArea.LegsCW );
		return result;
	}

	public static function IsItemTypeCyberwareWeapon( itemType : gamedataItemType ) : Bool
	{
		return ( ( itemType == gamedataItemType.Cyb_Launcher || itemType == gamedataItemType.Cyb_MantisBlades ) || itemType == gamedataItemType.Cyb_NanoWires ) || itemType == gamedataItemType.Cyb_StrongArms;
	}

	public static function IsItemTypeCyberware( itemType : gamedataItemType ) : Bool
	{
		return ( ( UIInventoryItemsManager.IsItemTypeCyberwareWeapon( itemType ) || itemType == gamedataItemType.Cyberware ) || itemType == gamedataItemType.Cyb_Ability ) || itemType == gamedataItemType.Cyb_HealingAbility;
	}

	public static function IsItemTypeCloting( itemType : gamedataItemType ) : Bool
	{
		return ( ( ( ( ( itemType == gamedataItemType.Clo_Face || itemType == gamedataItemType.Clo_Feet ) || itemType == gamedataItemType.Clo_Head ) || itemType == gamedataItemType.Clo_InnerChest ) || itemType == gamedataItemType.Clo_Legs ) || itemType == gamedataItemType.Clo_OuterChest ) || itemType == gamedataItemType.Clo_Outfit;
	}

	public static function IsItemTypeGrenade( itemType : gamedataItemType ) : Bool
	{
		return itemType == gamedataItemType.Gad_Grenade;
	}

	public static function IsItemTypeMeleeWeapon( itemType : gamedataItemType ) : Bool
	{
		return ( ( ( ( ( ( ( ( ( ( ( itemType == gamedataItemType.Wea_TwoHandedClub || itemType == gamedataItemType.Wea_ShortBlade ) || itemType == gamedataItemType.Wea_OneHandedClub ) || itemType == gamedataItemType.Wea_Melee ) || itemType == gamedataItemType.Wea_LongBlade ) || itemType == gamedataItemType.Wea_Katana ) || itemType == gamedataItemType.Wea_Sword ) || itemType == gamedataItemType.Wea_Knife ) || itemType == gamedataItemType.Wea_Axe ) || itemType == gamedataItemType.Wea_Chainsword ) || itemType == gamedataItemType.Wea_Machete ) || itemType == gamedataItemType.Wea_Fists ) || itemType == gamedataItemType.Wea_Hammer;
	}

	public static function IsItemTypeRangedWeapon( itemType : gamedataItemType ) : Bool
	{
		return ( ( ( ( ( ( ( ( ( itemType == gamedataItemType.Wea_AssaultRifle || itemType == gamedataItemType.Wea_Handgun ) || itemType == gamedataItemType.Wea_HeavyMachineGun ) || itemType == gamedataItemType.Wea_LightMachineGun ) || itemType == gamedataItemType.Wea_PrecisionRifle ) || itemType == gamedataItemType.Wea_Revolver ) || itemType == gamedataItemType.Wea_Rifle ) || itemType == gamedataItemType.Wea_Shotgun ) || itemType == gamedataItemType.Wea_ShotgunDual ) || itemType == gamedataItemType.Wea_SniperRifle ) || itemType == gamedataItemType.Wea_SubmachineGun;
	}

	public static function ShouldHideTier( itemType : gamedataItemType ) : Bool
	{
		return ( ( ( ( ( ( ( ( ( ( ( ( ( itemType == gamedataItemType.Clo_Face || itemType == gamedataItemType.Clo_Feet ) || itemType == gamedataItemType.Clo_Head ) || itemType == gamedataItemType.Clo_InnerChest ) || itemType == gamedataItemType.Clo_Legs ) || itemType == gamedataItemType.Clo_OuterChest ) || itemType == gamedataItemType.Clo_Outfit ) || itemType == gamedataItemType.Con_Ammo ) || itemType == gamedataItemType.Con_Edible ) || itemType == gamedataItemType.Gen_Keycard ) || itemType == gamedataItemType.Gen_Misc ) || itemType == gamedataItemType.Gen_Tarot ) || itemType == gamedataItemType.Gen_Jewellery ) || itemType == gamedataItemType.Gen_Junk ) || itemType == gamedataItemType.Gen_Readable;
	}

	public static function QualityToInt( quality : gamedataQuality ) : Int32
	{
		return UIItemsHelper.QualityEnumToInt( quality );
	}

	public static function QualityToName( quality : gamedataQuality ) : CName
	{
		return UIItemsHelper.QualityEnumToName( quality );
	}

	public static function QualityFromInt( quality : Int32 ) : gamedataQuality
	{
		switch( quality )
		{
			case 0:
				return gamedataQuality.Common;
			case 1:
				return gamedataQuality.Uncommon;
			case 2:
				return gamedataQuality.Rare;
			case 3:
				return gamedataQuality.Epic;
			case 4:
				return gamedataQuality.Legendary;
			case 5:
				return gamedataQuality.Iconic;
		}
		return gamedataQuality.Invalid;
	}

}

class WeaponMaxStatValueData
{
	var stat : gamedataStatType;
	var value : Float;
}

