private Wish TryGiveWishFromWishDefDirect(WishDef def, Pawn pawn) { Wish wish = (Wish)Activator.CreateInstance(def.wishClass); wish.def = def; wish.pawn = pawn; wish.PostMake(); return(!wish.makeFailed ? wish : null); }
public virtual IEnumerable <string> ConfigErrors(WishDef parentDef) { if (compClass == null) { yield return("compClass is null"); } for (int i = 0; i < parentDef.comps.Count; i++) { if (parentDef.comps[i] != this && parentDef.comps[i].compClass == compClass) { yield return("two comps with same compClass: " + compClass); } } }
public Wish(Pawn pawn, WishDef def) { this.pawn = pawn; this.def = def; }