示例#1
0
        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);
        }
示例#2
0
 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);
         }
     }
 }
示例#3
0
文件: Wish.cs 项目: Sielfyr/Dream
 public Wish(Pawn pawn, WishDef def)
 {
     this.pawn = pawn;
     this.def  = def;
 }