class StatusEffectRemovedPrereqState extends StatusEffectPrereqState
{

	public override function StatusEffectUpdate( statusEffect : weak< StatusEffect_Record >, isApplied : Bool )
	{
		var checkPassed : Bool;
		const var prereq : StatusEffectRemovedPrereq;
		if( !( isApplied ) )
		{
			prereq = ( ( StatusEffectRemovedPrereq )( GetPrereq() ) );
			checkPassed = prereq.Evaluate( statusEffect );
			if( prereq.m_fireAndForget )
			{
				if( checkPassed )
				{
					OnChangedRepeated( false );
				}
			}
			else
			{
				OnChanged( checkPassed );
			}
		}
	}

}

class StatusEffectRemovedPrereq extends StatusEffectPrereq
{

	protected override function Initialize( recordID : TweakDBID )
	{
		var record : StatusEffectPrereq_Record;
		record = TweakDBInterface.GetStatusEffectPrereqRecord( recordID );
		m_statusEffectRecordID = record.StatusEffect().GetID();
		m_checkType = record.CheckType().Type();
		m_fireAndForget = TweakDBInterface.GetBool( recordID + T".fireAndForget", false );
	}

	public const override function Evaluate( statusEffect : weak< StatusEffect_Record > ) : Bool
	{
		var result : Bool;
		switch( m_checkType )
		{
			case gamedataCheckType.Record:
				result = m_statusEffectRecordID == statusEffect.GetID();
			break;
			case gamedataCheckType.Type:
				result = TweakDBInterface.GetStatusEffectRecord( m_statusEffectRecordID ).StatusEffectType().Type() == statusEffect.StatusEffectType().Type();
			break;
			default:
				return false;
		}
		return result;
	}

}

