// Token: 0x06003F1D RID: 16157 RVA: 0x001D8D98 File Offset: 0x001D7198
        private static List <Pair <IAttackTarget, float> > GetAvailableShootingTargetsByScore(List <IAttackTarget> rawTargets, IAttackTargetSearcher searcher, Verb verb)
        {
            XenomorphTargetFinder.availableShootingTargets.Clear();
            if (rawTargets.Count == 0)
            {
                return(XenomorphTargetFinder.availableShootingTargets);
            }
            XenomorphTargetFinder.tmpTargetScores.Clear();
            XenomorphTargetFinder.tmpCanShootAtTarget.Clear();
            float         num          = 0f;
            IAttackTarget attackTarget = null;

            for (int i = 0; i < rawTargets.Count; i++)
            {
                XenomorphTargetFinder.tmpTargetScores.Add(float.MinValue);
                XenomorphTargetFinder.tmpCanShootAtTarget.Add(false);
                if (rawTargets[i] != searcher)
                {
                    bool flag = XenomorphTargetFinder.CanShootAtFromCurrentPosition(rawTargets[i], searcher, verb);
                    XenomorphTargetFinder.tmpCanShootAtTarget[i] = flag;
                    if (flag)
                    {
                        float shootingTargetScore = XenomorphTargetFinder.GetShootingTargetScore(rawTargets[i], searcher, verb);
                        XenomorphTargetFinder.tmpTargetScores[i] = shootingTargetScore;
                        if (attackTarget == null || shootingTargetScore > num)
                        {
                            attackTarget = rawTargets[i];
                            num          = shootingTargetScore;
                        }
                    }
                }
            }
            if (num < 1f)
            {
                if (attackTarget != null)
                {
                    XenomorphTargetFinder.availableShootingTargets.Add(new Pair <IAttackTarget, float>(attackTarget, 1f));
                }
            }
            else
            {
                float num2 = num - 30f;
                for (int j = 0; j < rawTargets.Count; j++)
                {
                    if (rawTargets[j] != searcher)
                    {
                        if (XenomorphTargetFinder.tmpCanShootAtTarget[j])
                        {
                            float num3 = XenomorphTargetFinder.tmpTargetScores[j];
                            if (num3 >= num2)
                            {
                                float second = Mathf.InverseLerp(num - 30f, num, num3);
                                XenomorphTargetFinder.availableShootingTargets.Add(new Pair <IAttackTarget, float>(rawTargets[j], second));
                            }
                        }
                    }
                }
            }
            return(XenomorphTargetFinder.availableShootingTargets);
        }
        // Token: 0x06003F24 RID: 16164 RVA: 0x001D9728 File Offset: 0x001D7B28
        public static void DebugDrawAttackTargetScores_OnGUI()
        {
            IAttackTargetSearcher attackTargetSearcher = Find.Selector.SingleSelectedThing as IAttackTargetSearcher;

            if (attackTargetSearcher == null)
            {
                return;
            }
            if (attackTargetSearcher.Thing.Map != Find.CurrentMap)
            {
                return;
            }
            Verb currentEffectiveVerb = attackTargetSearcher.CurrentEffectiveVerb;

            if (currentEffectiveVerb == null)
            {
                return;
            }
            List <Thing> list = attackTargetSearcher.Thing.Map.listerThings.ThingsInGroup(ThingRequestGroup.AttackTarget);

            Text.Anchor = TextAnchor.MiddleCenter;
            Text.Font   = GameFont.Tiny;
            for (int i = 0; i < list.Count; i++)
            {
                Thing thing = list[i];
                if (thing != attackTargetSearcher)
                {
                    string text;
                    Color  red;
                    if (!XenomorphTargetFinder.CanShootAtFromCurrentPosition((IAttackTarget)thing, attackTargetSearcher, currentEffectiveVerb))
                    {
                        text = "out of range";
                        red  = Color.red;
                    }
                    else
                    {
                        text = XenomorphTargetFinder.GetShootingTargetScore((IAttackTarget)thing, attackTargetSearcher, currentEffectiveVerb).ToString("F0");
                        red  = new Color(0.25f, 1f, 0.25f);
                    }
                    Vector2 screenPos = thing.DrawPos.MapToUIPosition();
                    GenMapUI.DrawThingLabel(screenPos, text, red);
                }
            }
            Text.Anchor = TextAnchor.UpperLeft;
            Text.Font   = GameFont.Small;
        }