コード例 #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;
 }