class HitStatPoolPrereqState extends GenericHitPrereqState
{

	public override function Evaluate( hitEvent : gameHitEvent ) : Bool
	{
		var checkPassed : Bool;
		const var prereq : HitStatPoolPrereq;
		prereq = ( ( HitStatPoolPrereq )( GetPrereq() ) );
		checkPassed = ComparePoolValues( hitEvent, prereq );
		return checkPassed;
	}

	private function ComparePoolValues( hitEvent : gameHitEvent, const prereq : HitStatPoolPrereq ) : Bool
	{
		var sps : StatPoolsSystem;
		var obj : weak< GameObject >;
		var poolValue : Float;
		obj = GetObjectToCheck( prereq.m_objectToCheck, hitEvent );
		if( !( obj ) )
		{
			return false;
		}
		sps = GameInstance.GetStatPoolsSystem( obj.GetGame() );
		poolValue = sps.GetStatPoolValue( obj.GetEntityID(), prereq.m_statPoolToCompare );
		return ProcessCompare( prereq.m_comparisonType, prereq.m_valueToCheck, poolValue );
	}

}

class HitStatPoolPrereq extends GenericHitPrereq
{
	default m_isSync = true;
	default m_callbackType = gameDamageCallbackType.HitTriggered;
	default m_pipelineStage = gameDamagePipelineStage.Process;
	var m_valueToCheck : Float;
	var m_objectToCheck : String;
	var m_comparisonType : EComparisonType;
	var m_statPoolToCompare : gamedataStatPoolType;

	protected override function Initialize( recordID : TweakDBID )
	{
		var str : String;
		m_objectToCheck = TweakDBInterface.GetString( recordID + T".objectToCheck", "" );
		m_valueToCheck = TweakDBInterface.GetFloat( recordID + T".valueToCheck", 0.0 );
		str = TweakDBInterface.GetString( recordID + T".statPoolToCompare", "" );
		m_statPoolToCompare = ( ( gamedataStatPoolType )( ( ( Int32 )( EnumValueFromString( "gamedataStatPoolType", str ) ) ) ) );
		str = TweakDBInterface.GetString( recordID + T".comparisonType", "" );
		m_comparisonType = ( ( EComparisonType )( ( ( Int32 )( EnumValueFromString( "EComparisonType", str ) ) ) ) );
	}

}

