Example #1
0
        public void SetNature(NatureCategory ccor, ArtGenerationContext source)
        {
            this.ccint = ccor;
            CompArt compArt = this.parent.TryGetComp <CompArt>();

            if (compArt != null)
            {
                compArt.InitializeArt(source);
            }
        }
 public static bool TryGetNature(this Thing t, out NatureCategory cc)
 {
     MinifiedThing minifiedThing = t as MinifiedThing;
     CompNature compCorruption = (minifiedThing == null) ? t.TryGetComp<CompNature>() : minifiedThing.InnerThing.TryGetComp<CompNature>();
     if (compCorruption == null)
     {
         cc = NatureCategory.Common;
         return false;
     }
     cc = compCorruption.Nature;
     return true;
 }
 public static string GetLabelShort(this NatureCategory cat)
 {
     switch (cat)
     {
         case NatureCategory.Holy:
             return "CorruptionItemCategoryShort_Holy".Translate();
         case NatureCategory.Common:
             return "CorruptionItemCategoryShort_Common".Translate();
         case NatureCategory.Corrupted:
             return "CorruptionItemCategoryShort_Corrupted".Translate();
         default:
             throw new ArgumentException();
     }
 }
 static CorruptionItemUtility()
 {
     CorruptionItemUtility.AllNatureCategories = new List<NatureCategory>();
     IEnumerator enumerator = Enum.GetValues(typeof(NatureCategory)).GetEnumerator();
     try
     {
         while (enumerator.MoveNext())
         {
             NatureCategory item = (NatureCategory)((byte)enumerator.Current);
             CorruptionItemUtility.AllNatureCategories.Add(item);
         }
     }
     finally
     {
         IDisposable disposable = enumerator as IDisposable;
         if (disposable != null)
         {
             disposable.Dispose();
         }
     }
 }