class PlayerDoesntHaveQuickhackPrereqState extends PrereqState
{
}

class PlayerDoesntHaveQuickhackPrereq extends IScriptablePrereq
{
	var m_quickhackID : TweakDBID;

	protected override function Initialize( recordID : TweakDBID )
	{
		m_quickhackID = TDBID.Create( TweakDBInterface.GetString( recordID + T".quickhack", "" ) );
	}

	public const override function IsFulfilled( game : GameInstance, context : IScriptable ) : Bool
	{
		var playersHacks : array< weak< gameItemData > >;
		var playerHacksTweak : array< TweakDBID >;
		var i : Int32;
		var result : Bool;
		result = true;
		playerHacksTweak = PlayerPuppet.GetPlayerQuickHackInCyberDeckTweakDBID( GetPlayer( game ) );
		GameInstance.GetTransactionSystem( game ).GetItemListByTag( GetPlayer( game ), 'SoftwareShard', playersHacks );
		for( i = 0; i < playersHacks.Size(); i += 1 )
		{
			playerHacksTweak.PushBack( ItemID.GetTDBID( playersHacks[ i ].GetID() ) );
		}
		for( i = 0; i < playerHacksTweak.Size(); i += 1 )
		{
			if( playerHacksTweak[ i ] == m_quickhackID )
			{
				result = false;
			}
		}
		return result;
	}

}

