Exemplo n.º 1
0
        public SCFG_VipLevelTest2 Find(int id1)
        {
            SCFG_VipLevelTest2 ret = null;

            _mapContent.TryGetValue(id1, out ret);
            return(ret);
        }
Exemplo n.º 2
0
        public ECSVReadResult Load(string path)
        {
            var csvText = File.ReadAllText(path, Encoding.UTF8);

            if (string.IsNullOrEmpty(csvText))
            {
                return(ECSVReadResult.FileOpenError);
            }
            string[][] grid = CsvParser.Parse(csvText);
            if (grid == null)
            {
                return(ECSVReadResult.FormatError);
            }
            int rowLen = grid.Length;

            if (rowLen < 1)
            {
                return(ECSVReadResult.FormatError);
            }
            int colLen = grid[0].Length;

            if (colLen < 1)
            {
                return(ECSVReadResult.FormatError);
            }
            var parser = new StringParser(grid);
            int keyIdx = 0;

            for (int i = 3; i < rowLen; i++)
            {
                var info   = new SCFG_VipLevelTest2();
                var key    = parser.ReadInt32(i, keyIdx);
                int colIdx = 0;
                info.id1 = parser.ReadInt32(i, colIdx++);
                info.id2 = parser.ReadString(i, colIdx++);
                info.id3 = parser.ReadInt32(i, colIdx++);
                info.id4 = parser.ReadString(i, colIdx++);
                info.id6 = parser.ReadString(i, colIdx++);

                _mapContent.Add(key, info);
            }
            return(ECSVReadResult.Succ);
        }