<commit_before>﻿using System;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading;

using RimWorld;
using Verse;
using Verse.AI;

namespace CommunityCoreLibrary.Detour
{

    internal static class _JobDriver_FoodFeedPatient
    {
        
        internal static IEnumerable<Toil> _MakeNewToils( this JobDriver_FoodFeedPatient obj )
        {
            Pawn deliveree = (Pawn) obj.pawn.CurJob.targetB.Thing;
            obj.FailOnDespawnedNullOrForbidden( TargetIndex.B );
            obj.FailOn( ( Func<bool> )( () =>
                {
                    return
                        ( deliveree.GetPosture() == PawnPosture.Standing )||
                        ( deliveree.HostFaction != null )&&
                        ( !deliveree.guest.ShouldBeBroughtFood );
                }
            ) );

            yield return Toils_Reserve.Reserve( TargetIndex.B, 1 );

            var targetThingA = obj.TargetThingA();

            if( targetThingA is Building )
            {
                yield return Toils_Goto.GotoThing( TargetIndex.A, PathEndMode.InteractionCell ).FailOnForbidden( TargetIndex.A );
                if( targetThingA is Building_NutrientPasteDispenser )
                {
                    yield return Toils_Ingest.TakeMealFromDispenser( TargetIndex.A, obj.pawn );
                }
                if( targetThingA is Building_AutomatedFactory )
                {
                    yield return Toils_FoodSynthesizer.TakeMealFromSynthesizer( TargetIndex.A, obj.pawn );
                }
            }
            else
            {
                yield return Toils_Reserve.Reserve( TargetIndex.A, 1 );
                yield return Toils_Goto.GotoThing( TargetIndex.A, PathEndMode.ClosestTouch ).FailOnForbidden( TargetIndex.A );
                yield return Toils_Ingest.PickupIngestible( TargetIndex.A, deliveree );
            }

            yield return Toils_Goto.GotoThing( TargetIndex.B, PathEndMode.Touch );
            yield return Toils_Ingest.ChewIngestible( deliveree, 1.5f, TargetIndex.A );
            yield return Toils_Ingest.FinalizeIngest( deliveree, TargetIndex.A );
        }

    }

}<commit_msg>commented out broken code, TODOs in here<commit_after>﻿using System;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading;

using RimWorld;
using Verse;
using Verse.AI;

namespace CommunityCoreLibrary.Detour
{

    internal static class _JobDriver_FoodFeedPatient
    {
        // TODO: see other todos
        /*internal static IEnumerable<Toil> _MakeNewToils( this JobDriver_FoodFeedPatient obj )
        {
            Pawn deliveree = (Pawn) obj.pawn.CurJob.targetB.Thing;
            obj.FailOnDespawnedNullOrForbidden( TargetIndex.B );
            obj.FailOn( ( Func<bool> )( () =>
                {
                    return
                        ( deliveree.GetPosture() == PawnPosture.Standing )||
                        ( deliveree.HostFaction != null )&&
                        ( !deliveree.guest.ShouldBeBroughtFood );
                }
            ) );

            yield return Toils_Reserve.Reserve( TargetIndex.B, 1 );

            var targetThingA = obj.TargetThingA();

            if( targetThingA is Building )
            {
                yield return Toils_Goto.GotoThing( TargetIndex.A, PathEndMode.InteractionCell ).FailOnForbidden( TargetIndex.A );
                if( targetThingA is Building_NutrientPasteDispenser )
                {
                    yield return Toils_Ingest.TakeMealFromDispenser( TargetIndex.A, obj.pawn );
                }
                if( targetThingA is Building_AutomatedFactory )
                {
                    yield return Toils_FoodSynthesizer.TakeMealFromSynthesizer( TargetIndex.A, obj.pawn );
                }
            }
            else
            {
                yield return Toils_Reserve.Reserve( TargetIndex.A, 1 );
                yield return Toils_Goto.GotoThing( TargetIndex.A, PathEndMode.ClosestTouch ).FailOnForbidden( TargetIndex.A );
                yield return Toils_Ingest.PickupIngestible( TargetIndex.A, deliveree );
            }

            yield return Toils_Goto.GotoThing( TargetIndex.B, PathEndMode.Touch );
            yield return Toils_Ingest.ChewIngestible( deliveree, 1.5f, TargetIndex.A );
            yield return Toils_Ingest.FinalizeIngest( deliveree, TargetIndex.A );
        }*/

    }

}
{'fraction_non_alphanumeric': 0.07994786009124484, 'fraction_numerical': 0.0017379969585053225, 'mean_word_length': 1.94185303514377, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4932007', 'n_tokens_mistral': 1336, 'n_tokens_neox': 1298, 'n_words': 246}