public AchievementCard(AchievementDef def, bool preUnlocked = false)
 {
     this.def = def;
     tab      = def.tab;
     if (tab is null)
     {
         tab = AchievementTabHelper.MainTab;
     }
     uniqueHash           = def.defName.GetHashCode();
     unlocked             = preUnlocked;
     tracker              = (TrackerBase)Activator.CreateInstance(def.tracker.GetType(), new object[] { def.tracker });
     tracker.cardAssigned = this.def.defName;
 }
예제 #2
0
 /// <summary>
 /// Must include for Instance creation.
 /// Passes in reference to Tracker of same type with fields populated from XML values
 /// </summary>
 /// <param name="reference"></param>
 public TrackerBase(TrackerBase reference)
 {
     uniqueId = Find.UniqueIDsManager.GetNextThingID();
 }