Пример #1
0
        private void VerifyMarksPresent(LegalityAnalysis data, IRibbonIndex m)
        {
            bool hasOne = false;

            for (var mark = RibbonIndex.MarkLunchtime; mark <= RibbonIndex.MarkSlump; mark++)
            {
                bool has = m.GetRibbon((int)mark);
                if (!has)
                {
                    continue;
                }

                if (hasOne)
                {
                    data.AddLine(GetInvalid(string.Format(LRibbonMarkingFInvalid_0, mark)));
                    return;
                }

                bool result = IsMarkValid(mark, data.pkm, data.EncounterMatch);
                if (!result)
                {
                    data.AddLine(GetInvalid(string.Format(LRibbonMarkingFInvalid_0, mark)));
                    return;
                }

                hasOne = true;
            }
        }
Пример #2
0
 private void VerifyNoMarksPresent(LegalityAnalysis data, IRibbonIndex m)
 {
     for (var x = RibbonIndex.MarkLunchtime; x <= RibbonIndex.MarkSlump; x++)
     {
         if (m.GetRibbon((int)x))
         {
             data.AddLine(GetInvalid(string.Format(LRibbonMarkingFInvalid_0, x)));
         }
     }
 }
Пример #3
0
        private static bool HasMark(IRibbonIndex pk, MarkIndex target, bool specific)
        {
            if (!specific)
            {
                for (var mark = RibbonIndex.MarkLunchtime; mark <= RibbonIndex.MarkSlump; mark++)
                {
                    if ((!specific && pk.GetRibbon((int)mark)) || (specific && pk.GetRibbon((int)mark) && mark.Equals(target)))
                    {
                        return(true);
                    }
                }
            }
            else if (specific && pk.GetRibbon((int)target))
            {
                return(true);
            }

            return(false);
        }
Пример #4
0
 private static bool HasMark(IRibbonIndex pk)
 {
     for (var mark = RibbonIndex.MarkLunchtime; mark <= RibbonIndex.MarkSlump; mark++)
     {
         if (pk.GetRibbon((int)mark))
         {
             return(true);
         }
     }
     return(false);
 }
Пример #5
0
 public static string GetMarkName(IRibbonIndex pk)
 {
     for (var mark = RibbonIndex.MarkLunchtime; mark <= RibbonIndex.MarkSlump; mark++)
     {
         if (pk.GetRibbon((int)mark))
         {
             return(RibbonStrings.GetName($"Ribbon{mark}"));
         }
     }
     return("");
 }
Пример #6
0
 public static string GetMarkName(IRibbonIndex pk)
 {
     for (var mark = RibbonIndex.MarkLunchtime; mark <= RibbonIndex.MarkSlump; mark++)
     {
         if (pk.GetRibbon((int)mark))
         {
             return($"\nPokémon found to have **{RibbonStrings.GetName($"Ribbon{mark}")}**!");
         }
     }
     return("");
 }
 public static bool HasMark(IRibbonIndex pk, out RibbonIndex result)
 {
     result = default;
     for (var mark = RibbonIndex.MarkLunchtime; mark <= RibbonIndex.MarkSlump; mark++)
     {
         if (pk.GetRibbon((int)mark))
         {
             result = mark;
             return(true);
         }
     }
     return(false);
 }
Пример #8
0
 public static bool GetRibbonIndex(this IRibbonIndex x, RibbonIndex r) => x.GetRibbon((int)r);