class HasNetworkPrereq extends IScriptablePrereq
{
	var m_invert : Bool;

	protected override function Initialize( recordID : TweakDBID )
	{
		m_invert = TweakDBInterface.GetBool( recordID + T".invert", false );
	}

	protected const override function OnRegister( state : PrereqState, game : GameInstance, context : IScriptable ) : Bool
	{
		state.OnChanged( IsFulfilled( game, context ) );
		return true;
	}

	public const override function IsFulfilled( game : GameInstance, context : IScriptable ) : Bool
	{
		var checkPassed : Bool;
		var owner : weak< GameObject >;
		owner = ( ( GameObject )( context ) );
		if( owner )
		{
			checkPassed = owner.IsConnectedToBackdoorDevice() || ( owner.IsBackdoor() && owner.HasAnySlaveDevices() );
			if( m_invert )
			{
				checkPassed = !( checkPassed );
			}
			return checkPassed;
		}
		return false;
	}

}

