private void QRSearch_Click(object sender, EventArgs e) { uint InitialSeed = (uint)Seed.Value; int min = (int)Frame_min.Value; int max = (int)Frame_max.Value; if (QRList.Text == "") { return; } string[] str = QRList.Text.Split(','); try { int[] Clock_List = str.Select(s => int.Parse(s)).ToArray(); int[] temp_List = new int[Clock_List.Length]; SFMT sfmt = new SFMT(InitialSeed); SFMT seed = new SFMT(InitialSeed); bool flag = false; QRResult.Items.Clear(); for (int i = 0; i < min; i++) { sfmt.NextUInt64(); } int cnt = 0; int tmp = 0; for (int i = min; i <= max; i++, sfmt.NextUInt64()) { seed = (SFMT)sfmt.DeepCopy(); for (int j = 0; j < Clock_List.Length; j++) { temp_List[j] = (int)(seed.NextUInt64() % 17); } if (temp_List.SequenceEqual(Clock_List)) { flag = true; } if (flag) { flag = false; switch (lindex) { case 0: QRResult.Items.Add($"The last clock is at {i + Clock_List.Length - 1}F, you're at {i + Clock_List.Length + 1}F after quiting QR"); break; case 1: QRResult.Items.Add($"最后的指针在 {i + Clock_List.Length - 1} 帧,退出QR后在 {i + Clock_List.Length + 1} 帧"); break; } cnt++; tmp = i + Clock_List.Length + 1; } } if (cnt == 1) { Time_min.Value = tmp; } } catch { Error(SETTINGERROR_STR[lindex] + L_QRList.Text); } }
private NPCStatus CreateNPCStatus(SFMT sfmt) { NPCStatus.npcnumber = (int)NPC.Value + 1; NPCStatus.smft = (SFMT)sfmt.DeepCopy(); return(new NPCStatus()); }