Обновлен RegexHandler

Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
2025-03-02 12:26:23 +07:00
parent 65070cd85b
commit 39961e91d9
2 changed files with 3 additions and 2 deletions

View File

@@ -100,7 +100,7 @@ namespace SaveWizard_rewritten
{ {
{ "base", true } { "base", true }
}; };
List<string> companies = RegexHandler.GetArrayItems(RegexHandler.SearchLine("companies:")); List<string> companies = RegexHandler.GetArrayItems("companies:");
foreach (string company in companies) foreach (string company in companies)
foreach (KeyValuePair<string, string> item in dlc) foreach (KeyValuePair<string, string> item in dlc)
if (company.Contains(item.Value)) if (company.Contains(item.Value))

View File

@@ -106,9 +106,10 @@ namespace SaveWizard_rewritten
// return 0; // return 0;
//} //}
public static List<string> GetArrayItems(int line) public static List<string> GetArrayItems(string search_term)
{ {
List<string> items = new List<string>(); List<string> items = new List<string>();
int line = SearchLine(search_term);
for (int i = 0; i < GetArrayLength(line); i++) for (int i = 0; i < GetArrayLength(line); i++)
items.Add(Regex.Match(lines[line + i + 1], ": (.+)$").Groups[1].ToString()); items.Add(Regex.Match(lines[line + i + 1], ": (.+)$").Groups[1].ToString());
if (items.Count == 0) if (items.Count == 0)