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; } }
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))); } } }
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); }
private static bool HasMark(IRibbonIndex pk) { for (var mark = RibbonIndex.MarkLunchtime; mark <= RibbonIndex.MarkSlump; mark++) { if (pk.GetRibbon((int)mark)) { return(true); } } return(false); }
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(""); }
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); }
public static bool GetRibbonIndex(this IRibbonIndex x, RibbonIndex r) => x.GetRibbon((int)r);