public BestiaryEntry Register(BestiaryEntry entry)
 {
     _entries.Add(entry);
     for (int i = 0; i < entry.Info.Count; i++)
     {
         NPCNetIdBestiaryInfoElement nPCNetIdBestiaryInfoElement = entry.Info[i] as NPCNetIdBestiaryInfoElement;
         if (nPCNetIdBestiaryInfoElement != null)
         {
             _byNpcId[nPCNetIdBestiaryInfoElement.NetId] = entry;
         }
     }
     return(entry);
 }
Ejemplo n.º 2
0
            public int Compare(BestiaryEntry x, BestiaryEntry y)
            {
                NPCNetIdBestiaryInfoElement bestiaryInfoElement1 = x.Info.FirstOrDefault <IBestiaryInfoElement>((Func <IBestiaryInfoElement, bool>)(element => element is NPCNetIdBestiaryInfoElement)) as NPCNetIdBestiaryInfoElement;
                NPCNetIdBestiaryInfoElement bestiaryInfoElement2 = y.Info.FirstOrDefault <IBestiaryInfoElement>((Func <IBestiaryInfoElement, bool>)(element => element is NPCNetIdBestiaryInfoElement)) as NPCNetIdBestiaryInfoElement;

                if (bestiaryInfoElement1 == null && bestiaryInfoElement2 != null)
                {
                    return(1);
                }
                if (bestiaryInfoElement2 == null && bestiaryInfoElement1 != null)
                {
                    return(-1);
                }
                return(bestiaryInfoElement1 == null || bestiaryInfoElement2 == null ? 0 : ContentSamples.NpcBestiarySortingId[bestiaryInfoElement1.NetId].CompareTo(ContentSamples.NpcBestiarySortingId[bestiaryInfoElement2.NetId]));
            }
Ejemplo n.º 3
0
            public int Compare(BestiaryEntry x, BestiaryEntry y)
            {
                NPCNetIdBestiaryInfoElement bestiaryInfoElement1 = x.Info.FirstOrDefault <IBestiaryInfoElement>((Func <IBestiaryInfoElement, bool>)(element => element is NPCNetIdBestiaryInfoElement)) as NPCNetIdBestiaryInfoElement;
                NPCNetIdBestiaryInfoElement bestiaryInfoElement2 = y.Info.FirstOrDefault <IBestiaryInfoElement>((Func <IBestiaryInfoElement, bool>)(element => element is NPCNetIdBestiaryInfoElement)) as NPCNetIdBestiaryInfoElement;

                if (bestiaryInfoElement1 == null && bestiaryInfoElement2 != null)
                {
                    return(1);
                }
                if (bestiaryInfoElement2 == null && bestiaryInfoElement1 != null)
                {
                    return(-1);
                }
                return(bestiaryInfoElement1 == null || bestiaryInfoElement2 == null ? 0 : Language.GetTextValue(ContentSamples.NpcsByNetId[bestiaryInfoElement1.NetId].TypeName).CompareTo(Language.GetTextValue(ContentSamples.NpcsByNetId[bestiaryInfoElement2.NetId].TypeName)));
            }
Ejemplo n.º 4
0
            public int Compare(BestiaryEntry x, BestiaryEntry y)
            {
                NPCNetIdBestiaryInfoElement nPCNetIdBestiaryInfoElement  = x.Info.FirstOrDefault((IBestiaryInfoElement element) => element is NPCNetIdBestiaryInfoElement) as NPCNetIdBestiaryInfoElement;
                NPCNetIdBestiaryInfoElement nPCNetIdBestiaryInfoElement2 = y.Info.FirstOrDefault((IBestiaryInfoElement element) => element is NPCNetIdBestiaryInfoElement) as NPCNetIdBestiaryInfoElement;

                if (nPCNetIdBestiaryInfoElement == null && nPCNetIdBestiaryInfoElement2 != null)
                {
                    return(1);
                }
                if (nPCNetIdBestiaryInfoElement2 == null && nPCNetIdBestiaryInfoElement != null)
                {
                    return(-1);
                }
                if (nPCNetIdBestiaryInfoElement == null || nPCNetIdBestiaryInfoElement2 == null)
                {
                    return(0);
                }
                return(nPCNetIdBestiaryInfoElement.NetId.CompareTo(nPCNetIdBestiaryInfoElement2.NetId));
            }
Ejemplo n.º 5
0
            public int Compare(BestiaryEntry x, BestiaryEntry y)
            {
                NPCNetIdBestiaryInfoElement nPCNetIdBestiaryInfoElement  = x.Info.FirstOrDefault((IBestiaryInfoElement element) => element is NPCNetIdBestiaryInfoElement) as NPCNetIdBestiaryInfoElement;
                NPCNetIdBestiaryInfoElement nPCNetIdBestiaryInfoElement2 = y.Info.FirstOrDefault((IBestiaryInfoElement element) => element is NPCNetIdBestiaryInfoElement) as NPCNetIdBestiaryInfoElement;

                if (nPCNetIdBestiaryInfoElement == null && nPCNetIdBestiaryInfoElement2 != null)
                {
                    return(1);
                }
                if (nPCNetIdBestiaryInfoElement2 == null && nPCNetIdBestiaryInfoElement != null)
                {
                    return(-1);
                }
                if (nPCNetIdBestiaryInfoElement == null || nPCNetIdBestiaryInfoElement2 == null)
                {
                    return(0);
                }
                int value = ContentSamples.NpcBestiaryRarityStars[nPCNetIdBestiaryInfoElement.NetId];

                return(ContentSamples.NpcBestiaryRarityStars[nPCNetIdBestiaryInfoElement2.NetId].CompareTo(value));
            }
Ejemplo n.º 6
0
            public int Compare(BestiaryEntry x, BestiaryEntry y)
            {
                NPCNetIdBestiaryInfoElement nPCNetIdBestiaryInfoElement  = x.Info.FirstOrDefault((IBestiaryInfoElement element) => element is NPCNetIdBestiaryInfoElement) as NPCNetIdBestiaryInfoElement;
                NPCNetIdBestiaryInfoElement nPCNetIdBestiaryInfoElement2 = y.Info.FirstOrDefault((IBestiaryInfoElement element) => element is NPCNetIdBestiaryInfoElement) as NPCNetIdBestiaryInfoElement;

                if (nPCNetIdBestiaryInfoElement == null && nPCNetIdBestiaryInfoElement2 != null)
                {
                    return(1);
                }
                if (nPCNetIdBestiaryInfoElement2 == null && nPCNetIdBestiaryInfoElement != null)
                {
                    return(-1);
                }
                if (nPCNetIdBestiaryInfoElement == null || nPCNetIdBestiaryInfoElement2 == null)
                {
                    return(0);
                }
                string textValue  = Language.GetTextValue(ContentSamples.NpcsByNetId[nPCNetIdBestiaryInfoElement.NetId].TypeName);
                string textValue2 = Language.GetTextValue(ContentSamples.NpcsByNetId[nPCNetIdBestiaryInfoElement2.NetId].TypeName);

                return(textValue.CompareTo(textValue2));
            }