private static BiMap <string, int> CreateMap(TagNode node) { var map = new BiMap <string, int>(); foreach (var(key, value) in node.ToTagCompound()) { map.Add(key, value.ToTagInt().Data); } return(map); }
public static void LoadCSV(this BiMap <string> d, string csv, char delim) { d.Clear(); csv = csv.ConvertNewlines(); string[] lines = csv.Split('\n'); for (int i = 0; i < lines.Length; i++) { if (lines[i].Length < 3) { continue; } if (lines[i][0] == '#') { continue; } string[] content = lines[i].Split(delim); for (int j = 0; j < content.Length; j += 2) { d.Add(content[j], content[j + 1]); } } }