27 {
29 {
30 dict =
new Dictionary<string, Dictionary<string, Item>>();
33 }
34 static void AddDir(string id, string path)
35 {
36 DirectoryInfo directoryInfo = new DirectoryInfo(path);
37 Dictionary<string, Item> dictionary = new Dictionary<string, Item>();
38 dict.Add(
id, dictionary);
39 FileInfo[] files = directoryInfo.GetFiles();
40 foreach (FileInfo fileInfo in files)
41 {
42 if (!(fileInfo.Extension != ".txt"))
43 {
44 StreamReader streamReader = new StreamReader(fileInfo.FullName);
45 string[] array = streamReader.ReadLine().Split(',');
47 {
48 cat = id,
50 author = ((array.Length >= 2 && !array[1].IsEmpty()) ? "nameAuthor".lang(array[1]) : "unknownAuthor".lang()),
51 chance = ((array.Length >= 3) ? array[2].ToInt() : 100),
52 skin = ((array.Length >= 4) ? array[3].ToInt() : 0),
53 id = fileInfo.Name.Replace(fileInfo.Extension, "")
54 };
56 streamReader.Close();
57 }
58 }
59 }
60 }