예제 #1
0
 public void AddLifepath(Lifepath lp)
 {
     if (lp == null)
     {
         throw new ArgumentNullException();
     }
     LifepathList.Add(lp);
 }
예제 #2
0
 //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);
 }
        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));
 }