TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ LongestMatchingPrefix()

static int Terraria.ModLoader.LocalizationLoader.LongestMatchingPrefix ( LocalizationFile file,
string key )
inlinestaticpackage

Definition at line 739 of file LocalizationLoader.cs.

740 {
741 int num = ((!string.IsNullOrWhiteSpace(file.prefix)) ? file.prefix.Split(".").Length : 0);
743 string[] splitKey = key.Split(".");
744 for (int i = num; i < splitKey.Length; i++)
745 {
746 _ = splitKey[i];
747 string partialKey = string.Join(".", splitKey.Take(i + 1));
748 if (!localizationEntries.Any((LocalizationEntry x) => x.key.StartsWith(partialKey)))
749 {
750 return i;
751 }
752 }
753 return splitKey.Length;
754 }
record LocalizationEntry(string key, string value, string comment, JsonType type=0)

References Terraria.ModLoader.LocalizationLoader.LocalizationEntry().

Referenced by Terraria.ModLoader.LocalizationLoader.FindHJSONFileForKey().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: