LKCamelot.BinaryIO.LoadItems C# (CSharp) Method

LoadItems() public static method

public static LoadItems ( ) : List
return List
        public static List<script.item.Item> LoadItems()
        {
            var ret = new List<script.item.Item>();
            using (StreamReader sr = new StreamReader("worldsaveIt.txt"))
            {
                while (!sr.EndOfStream)
                {
                    string[] line = sr.ReadLine().Split(',');
                    script.item.Item temp = null;
                    try
                    {
                        temp = (script.item.Item)Activator.CreateInstance(Type.GetType("LKCamelot.script.item." + line[1]), (LKCamelot.model.Serial)Convert.ToInt32(line[0]));
                    }
                    catch { Console.WriteLine(line[1]); continue; }

                    temp.m_ItemID = Convert.ToInt32(line[2]);
                    temp.ParSer = Convert.ToInt32(line[3]);
                    try
                    {
                        temp.InvSlot = Convert.ToInt32(line[4]);
                    }
                    catch {
                        temp.InvSlot = 0;
                    }
                    temp.Stage = Convert.ToInt32(line[5]);
                    temp.Quantity = Convert.ToInt32(line[6]);
                    ret.Add(temp);
                }
            }
            return ret;
        }