21 {
22 dict =
new Dictionary<string, Dictionary<string, Item>>();
25 static void AddDir(string id, string path)
26 {
27 DirectoryInfo directoryInfo = new DirectoryInfo(path);
28 Dictionary<string, Item> dictionary = new Dictionary<string, Item>();
29 dict.Add(
id, dictionary);
30 FileInfo[] files = directoryInfo.GetFiles();
31 foreach (FileInfo fileInfo in files)
32 {
33 if (!(fileInfo.Extension != ".txt"))
34 {
35 StreamReader streamReader = new StreamReader(fileInfo.FullName);
36 string[] array = streamReader.ReadLine().Split(',');
38 {
40 author = ((array.Length >= 2 && !array[1].IsEmpty()) ? "nameAuthor".lang(array[1]) : "unknownAuthor".lang()),
41 chance = ((array.Length >= 3) ? array[2].ToInt() : 100),
42 id = fileInfo.Name.Replace(fileInfo.Extension, "")
43 };
45 streamReader.Close();
46 }
47 }
48 }
49 }