Ejemplo n.º 1
0
        public static bool IsBloodRelated(Genealogy a, Genealogy b, bool thoroughCheck)
        {
            if (a == b)
            {
                return(true);
            }

            if (a.Siblings.Contains(b))
            {
                return(true);
            }

            AncestorData aData = GetAncestorData(a);
            AncestorData bData = GetAncestorData(b);

            if (aData.IsDirect(b))
            {
                return(true);
            }
            else if (bData.IsDirect(a))
            {
                return(true);
            }
            else if (aData.IsSibling(b))
            {
                return(true);
            }
            else if (bData.IsSibling(a))
            {
                return(true);
            }

            foreach (Genealogy genealogy3 in a.mNaturalParents)
            {
                foreach (Genealogy genealogy4 in b.mNaturalParents)
                {
                    if (genealogy3.Siblings.Contains(genealogy4))
                    {
                        return(true);
                    }
                }
            }

            if (thoroughCheck)
            {
                if (aData.Overlaps(bData))
                {
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
        public static bool IsStepRelated(Genealogy a, Genealogy b)
        {
            if (a == null || b == null)
            {
                return(false);
            }

            AncestorData aData = GetAncestorData(a);
            AncestorData bData = GetAncestorData(b);

            return(aData.IsStepRelated(a, b));
        }
Ejemplo n.º 3
0
        public static AncestorData GetAncestorData(Genealogy a)
        {
            AncestorData ancestors;

            if (!sAncestors.TryGetValue(a, out ancestors))
            {
                ancestors = new AncestorData(a);
                sAncestors.Add(a, ancestors);
            }

            return(ancestors);
        }
Ejemplo n.º 4
0
            public bool Overlaps(AncestorData data)
            {
                foreach (Genealogy ancestor in mDirectAncestors.Keys)
                {
                    if (data.mDirectAncestors.ContainsKey(ancestor))
                    {
                        return(true);
                    }
                }

                return(false);
            }
Ejemplo n.º 5
0
            public bool Overlaps(AncestorData data)
            {
                foreach (Genealogy ancestor in mDirectAncestors.Keys)
                {
                    if (data.mDirectAncestors.ContainsKey(ancestor)) return true;
                }

                return false;
            }
Ejemplo n.º 6
0
        public static AncestorData GetAncestorData(Genealogy a)
        {
            AncestorData ancestors;
            if (!sAncestors.TryGetValue(a, out ancestors))
            {
                ancestors = new AncestorData(a);
                sAncestors.Add(a, ancestors);
            }

            return ancestors;
        }