class CharacterDataPrereqState extends PrereqState
{
}

class CharacterDataPrereq extends IScriptablePrereq
{
	var m_idToCheck : TweakDBID;

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

	protected const override function OnApplied( state : PrereqState, game : GameInstance, context : IScriptable )
	{
		var owner : weak< GameObject >;
		var castedState : CharacterDataPrereqState;
		owner = ( ( GameObject )( context ) );
		if( owner )
		{
			castedState = ( ( CharacterDataPrereqState )( state ) );
			castedState.OnChanged( IsFulfilled( game, context ) );
		}
	}

	public const override function IsFulfilled( game : GameInstance, context : IScriptable ) : Bool
	{
		var targetPuppet : ScriptedPuppet;
		targetPuppet = ( ( ScriptedPuppet )( context ) );
		return targetPuppet.GetRecordID() == m_idToCheck;
	}

}

