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