コード例 #1
0
ファイル: Character.cs プロジェクト: kestrelite/burning-wheel
 public void AddLifepath(Lifepath lp)
 {
     if (lp == null)
     {
         throw new ArgumentNullException();
     }
     LifepathList.Add(lp);
 }
コード例 #2
0
ファイル: Character.cs プロジェクト: kestrelite/burning-wheel
 //Bool indicates whether the item was actually in the list at all
 public bool DropLifepath(Lifepath lp)
 {
     if (LifepathList.Contains(lp))
     {
         LifepathList.Remove(lp);
         return(true);
     }
     return(false);
 }
コード例 #3
0
        public static int LifepathLeadsCount(Character character)
        {
            int      count  = 0;
            Lifepath lastLP = null;

            foreach (Lifepath lp in character.LifepathList)
            {
                if (lastLP != null && lastLP.LeadsTo(lp))
                {
                    count++;
                }
                lastLP = lp;
            }
            return(count);
        }
コード例 #4
0
        public bool LeadsTo(Lifepath lp2)
        {
            foreach (string s in Leads)
            {
                if (s.Equals(lp2.Setting))
                {
                    return(true);
                }
            }

            //User may manually opt for lifepath that isn't lead to explicitly,
            //so the default behavior is to assume it's a lead.
            if (!Setting.Equals(lp2.Setting))
            {
                return(true);
            }

            return(false);
        }
コード例 #5
0
 public bool LeadsTo(Lifepath arg1)
 {
 }
コード例 #6
0
        private static Lifepath copyLifepath(Lifepath lp)
        {
            string serialized = JsonConvert.SerializeObject(lp);

            return(JsonConvert.DeserializeObject <Lifepath>(serialized));
        }
コード例 #7
0
 public static bool AreEquivalent(Lifepath lpA, Lifepath lpB)
 {
     return(lpA.Name.Equals(lpB.Name) && lpA.Setting.Equals(lpB.Setting));
 }