importonly final class ItemCreationPrereqDataWrapper extends IScriptable
{
	public import function GetItemData() : gameItemData;
	public import function GetOwner() : IScriptable;
	public import function IsCreatedOnNPC() : Bool;
	public import function IsCreatedOnPlayer() : Bool;
	public import function IsCreatedOnLevel() : Bool;
}

class ItemCreationPrereq extends IScriptablePrereq
{
	var m_fireAndForget : Bool;
	editable var m_statType : gamedataStatType;
	editable var m_valueToCheck : Float;
	editable var m_comparisonType : EComparisonType;

	protected export override function Initialize( recordID : TweakDBID )
	{
		var record : ItemCreationPrereq_Record;
		record = TweakDBInterface.GetItemCreationPrereqRecord( recordID );
		m_statType = ( ( gamedataStatType )( ( ( Int32 )( EnumValueFromName( 'gamedataStatType', record.StatType() ) ) ) ) );
		m_valueToCheck = record.ValueToCheck();
		m_comparisonType = ( ( EComparisonType )( ( ( Int32 )( EnumValueFromName( 'EComparisonType', record.ComparisonType() ) ) ) ) );
	}

	public export const override function IsFulfilled( game : GameInstance, context : IScriptable ) : Bool
	{
		var currentValue : Float;
		var itemCreationPrereqDataWrapper : ItemCreationPrereqDataWrapper;
		var itemData : gameItemData;
		itemCreationPrereqDataWrapper = ( ( ItemCreationPrereqDataWrapper )( context ) );
		itemData = itemCreationPrereqDataWrapper.GetItemData();
		currentValue = itemData.GetStatValueByType( m_statType );
		return ProcessCompare( m_comparisonType, currentValue, m_valueToCheck );
	}

}

