| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text.RegularExpressions; |
| | | using Cysharp.Threading.Tasks; |
| | | using UnityEngine; |
| | | using System.Threading; |
| | | |
| | | public partial class DirtyNameConfig : ConfigBase<int, DirtyNameConfig> |
| | | { |
| | |
| | | } |
| | | |
| | | dirtyNameInited = true; |
| | | DirtyNameInitAsync().Forget(); |
| | | } |
| | | |
| | | ThreadPool.QueueUserWorkItem((object aaa) => |
| | | private static async UniTaskVoid DirtyNameInitAsync() |
| | | { |
| | | memoryList.Sort((string x, string y) => |
| | | { |
| | | memoryList.Sort((string x, string y) => |
| | | { |
| | | return x.CompareTo(y); |
| | | }); |
| | | for (int i = memoryList.Count - 1; i > 0; i--) |
| | | { |
| | | if (memoryList[i].ToString() == memoryList[i - 1].ToString()) |
| | | { |
| | | memoryList.RemoveAt(i); |
| | | } |
| | | } |
| | | foreach (string word in memoryList) |
| | | { |
| | | WordGroup group = DIRTYWORLD[(int)word[0]]; |
| | | if (group == null) |
| | | { |
| | | group = new WordGroup(); |
| | | DIRTYWORLD[(int)word[0]] = group; |
| | | } |
| | | group.Add(word.Substring(1)); |
| | | } |
| | | return x.CompareTo(y); |
| | | }); |
| | | await UniTask.Yield(); |
| | | for (int i = memoryList.Count - 1; i > 0; i--) |
| | | { |
| | | if (memoryList[i].ToString() == memoryList[i - 1].ToString()) |
| | | { |
| | | memoryList.RemoveAt(i); |
| | | } |
| | | } |
| | | await UniTask.Yield(); |
| | | int count = 0; |
| | | foreach (string word in memoryList) |
| | | { |
| | | WordGroup group = DIRTYWORLD[(int)word[0]]; |
| | | if (group == null) |
| | | { |
| | | group = new WordGroup(); |
| | | DIRTYWORLD[(int)word[0]] = group; |
| | | } |
| | | group.Add(word.Substring(1)); |
| | | count++; |
| | | if (count % 100 == 0) |
| | | await UniTask.Yield(); |
| | | } |
| | | } |
| | | |
| | | public static bool IsCHS(char character) |