// Token: 0x06001566 RID: 5478 RVA: 0x0007D285 File Offset: 0x0007B485
        public Graphic SubGraphicFor(Thing thing)
        {
            CompAdvancedGraphic comp    = thing.TryGetComp <CompAdvancedGraphic>();
            CompQuality         quality = thing.TryGetComp <CompQuality>();
            CompArt             art     = thing.TryGetComp <CompArt>();

            if (comp != null)
            {
                //	Log.Message("SubGraphicFor "+ thing.Label + " found CompAdvancedGraphic int " + comp.gfxint);
                if (!comp.Props.onlyArtable || (art != null && art.Active))
                {
                    if (comp.Props.quality)
                    {
                        return(this.SubGraphicForQuality(thing, comp));
                    }
                    if (comp.Props.randomised)
                    {
                        return(this.SubGraphicRandomized(thing, comp));
                    }
                }
                if (!comp.Props.tagged.NullOrEmpty())
                {
                    Graphic sub = subGraphics.FirstOrDefault(x => x.path.Contains(comp.Props.tagged));
                    if (sub != null)
                    {
                        return(subGraphics.FirstOrDefault(x => x.path.Contains(comp.Props.tagged)));
                    }
                }
            }
            else
            {
                //	Log.Message("SubGraphicFor " + thing.Label + " Didnt find CompAdvancedGraphic");
            }
            return(this.subGraphics[0]);
        }
        // Token: 0x06001568 RID: 5480 RVA: 0x0007D2D0 File Offset: 0x0007B4D0
        public Graphic SubGraphicForQuality(Thing thing, CompAdvancedGraphic advancedWeaponGraphic)
        {
            CompQuality quality = thing.TryGetComp <CompQuality>();

            if (quality == null)
            {
                Log.Warning(string.Format("WARNING!! {0} is set to use quality graphics but has no CompQuality, using random graphic", thing.Label));
                Rand.PushState();
                advancedWeaponGraphic.gfxint = Rand.RangeInclusive(0, subGraphics.Length - 1);
                Rand.PopState();
            }
            if (advancedWeaponGraphic.gfxint == -1)
            {
                if ((int)quality.Quality >= (int)advancedWeaponGraphic.Props.minQuality)
                {
                    int i = (int)quality.Quality - (int)advancedWeaponGraphic.Props.minQuality + 1;
                    advancedWeaponGraphic.gfxint = Math.Min(i, subGraphics.Length - 1);
                }
                else
                {
                    advancedWeaponGraphic.gfxint = 0;
                }
            }
            return(subGraphics[advancedWeaponGraphic.gfxint]);
        }
 // Token: 0x06001568 RID: 5480 RVA: 0x0007D2D0 File Offset: 0x0007B4D0
 public Graphic SubGraphicRandomized(Thing thing, CompAdvancedGraphic advancedWeaponGraphic)
 {
     if (advancedWeaponGraphic.gfxint == -1)
     {
         Rand.PushState();
         advancedWeaponGraphic.gfxint = Rand.RangeInclusive(0, subGraphics.Length - 1);
         Rand.PopState();
     }
     return(subGraphics[advancedWeaponGraphic.gfxint]);
 }
 // Token: 0x06001568 RID: 5480 RVA: 0x0007D2D0 File Offset: 0x0007B4D0
 public Graphic SubGraphicRandomized(Thing thing, CompAdvancedGraphic advancedWeaponGraphic)
 {
     if (advancedWeaponGraphic.gfxint == -1)
     {
         //	Log.Message("SubGraphicFor " + thing.Label + " init CompAdvancedGraphic int " + advancedWeaponGraphic.gfxint);
         Rand.PushState();
         advancedWeaponGraphic.gfxint = Rand.RangeInclusive(0, subGraphics.Length - 1);
         Rand.PopState();
     }
     //	Log.Message("SubGraphicFor " + thing.Label + " now CompAdvancedGraphic int " + advancedWeaponGraphic.gfxint);
     return(subGraphics[advancedWeaponGraphic.gfxint]);
 }
        // Token: 0x06001566 RID: 5478 RVA: 0x0007D285 File Offset: 0x0007B485
        public Graphic SubGraphicFor(Thing thing)
        {
            CompAdvancedGraphic advancedGraphic = thing.TryGetComp <CompAdvancedGraphic>();
            CompQuality         quality         = thing.TryGetComp <CompQuality>();
            CompArt             art             = thing.TryGetComp <CompArt>();

            if (advancedGraphic != null)
            {
                if (!advancedGraphic.Props.onlyArtable || (art != null && art.Active))
                {
                    if (advancedGraphic.Props.quality)
                    {
                        return(this.SubGraphicForQuality(thing, advancedGraphic));
                    }
                    if (advancedGraphic.Props.randomised)
                    {
                        return(this.SubGraphicRandomized(thing, advancedGraphic));
                    }
                }
            }
            return(this.subGraphics[0]);
        }