public void CalculateAndNotify(T pkm, PokeTradeDetail <T> detail, SeedCheckSettings settings, PokeTradeBot bot) { var ec = pkm.EncryptionConstant; var pid = pkm.PID; var IVs = pkm.IVs.Length == 0 ? GetBlankIVTemplate() : PKX.ReorderSpeedLast((int[])pkm.IVs.Clone()); var name = SpeciesName.GetSpeciesName(pkm.Species, 2); var ot = pkm.OT_Name; var abilityNo = pkm.AbilityNumber; var ability = pkm.Ability; var gender = pkm.GetSaneGender(); var nature = pkm.Nature; if (settings.ShowAllZ3Results) { var matches = Z3Search.GetAllSeeds(ec, pid, IVs, name, ot, gender, abilityNo, ability, nature); foreach (var match in matches) { var lump = new PokeTradeSummary("Calculated Seed:", match); detail.SendNotification(bot, lump); } } else { var match = Z3Search.GetFirstSeed(ec, pid, IVs, name, ot, gender, abilityNo, ability, nature); var lump = new PokeTradeSummary("Calculated Seed:", match); detail.SendNotification(bot, lump); } }
private void ReplyWithZ3Results(PokeTradeDetail <PK8> detail, PK8 result) { detail.SendNotification(this, "Calculating your seed(s)..."); if (result.IsShiny) { Connection.Log("The Pokemon is already shiny!"); // Do not bother checking for next shiny frame detail.SendNotification(this, "This Pokemon is already shiny! Raid seed calculation was not done."); detail.TradeFinished(this, result); return; } var ec = result.EncryptionConstant; var pid = result.PID; var IVs = result.IVs.Length == 0 ? GetBlankIVTemplate() : PKX.ReorderSpeedLast((int[])result.IVs.Clone()); if (Hub.Config.ShowAllZ3Results) { var matches = Z3Search.GetAllSeeds(ec, pid, IVs); foreach (var match in matches) { var msg = match.ToString(); detail.SendNotification(this, msg); } } else { var match = Z3Search.GetFirstSeed(ec, pid, IVs); var lump = new PokeTradeSummary("Calculated Seed:", match); detail.SendNotification(this, lump); } Connection.Log("Seed calculation completed."); }
public void CalculateAndNotify(T pkm, PokeTradeDetail <T> detail, SeedCheckSettings settings, PokeTradeBot bot) { var ec = pkm.EncryptionConstant; var pid = pkm.PID; var IVs = pkm.IVs.Length == 0 ? GetBlankIVTemplate() : PKX.ReorderSpeedLast((int[])pkm.IVs.Clone()); if (settings.ShowAllZ3Results) { var matches = Z3Search.GetAllSeeds(ec, pid, IVs); foreach (var match in matches) { var lump = new PokeTradeSummary("Calculated Seed:", match); detail.SendNotification(bot, lump); } } else { var match = Z3Search.GetFirstSeed(ec, pid, IVs); var lump = new PokeTradeSummary("Calculated Seed:", match); detail.SendNotification(bot, lump); } }
public void SendNotification(PokeRoutineExecutor routine, PokeTradeDetail <T> info, PokeTradeSummary message) { var msg = message.Summary; if (message.Details.Count > 0) { msg += ", " + string.Join(", ", message.Details.Select(z => $"{z.Heading}: {z.Detail}")); } LogUtil.LogInfo(msg, routine.Connection.Name); }
public void SendNotification(PokeRoutineExecutor routine, PokeTradeSummary obj) => Notifier.SendNotification(routine, this, obj);