Пример #1
0
        public static DataTest Read(TableManager tableManager, String fileName, ScorpioReader reader)
        {
            DataTest ret = new DataTest();

            ret._ID         = reader.ReadInt32();
            ret._TestInt    = reader.ReadInt32();
            ret._TestString = reader.ReadString();
            reader.ReadString();
            ret._TestLanguage = tableManager.getLanguageText(fileName + "_TestLanguage_" + ret._ID);
            ret._TestBool     = reader.ReadBool();
            ret._TestInt2     = Int2.Read(tableManager, fileName, reader);
            ret._TestEnumName = (TestEnum)reader.ReadInt32();
            {
                int        number = reader.ReadInt32();
                List <int> list   = new List <int> ();
                for (int i = 0; i < number; ++i)
                {
                    list.Add(reader.ReadInt32());
                }
                ret._TestArray = list.AsReadOnly();
            }
            {
                int         number = reader.ReadInt32();
                List <Int2> list   = new List <Int2> ();
                for (int i = 0; i < number; ++i)
                {
                    list.Add(Int2.Read(tableManager, fileName, reader));
                }
                ret._TestArray2 = list.AsReadOnly();
            }
            ret._TestInt3   = Int3.Read(tableManager, fileName, reader);
            ret.m_IsInvalid = ret.IsInvalid_impl();
            return(ret);
        }
Пример #2
0
        public static DataTest Read(ScorpioReader reader)
        {
            DataTest ret = new DataTest();

            ret._ID           = reader.ReadInt32();
            ret._TestInt      = reader.ReadInt32();
            ret._TestString   = reader.ReadString();
            ret._TestBool     = reader.ReadBool();
            ret._TestInt2     = Int2.Read(reader);
            ret._TestEnumName = (TestEnum)reader.ReadInt32();
            {
                int        number = reader.ReadInt32();
                List <int> list   = new List <int> ();
                for (int i = 0; i < number; ++i)
                {
                    list.Add(reader.ReadInt32());
                }
                ret._TestArray = list.AsReadOnly();
            }
            {
                int         number = reader.ReadInt32();
                List <Int2> list   = new List <Int2> ();
                for (int i = 0; i < number; ++i)
                {
                    list.Add(Int2.Read(reader));
                }
                ret._TestArray2 = list.AsReadOnly();
            }
            ret._TestInt3   = Int3.Read(reader);
            ret.m_IsInvalid = ret.IsInvalid_impl();
            return(ret);
        }
Пример #3
0
        public static int ReadHead(ScorpioReader reader, string fileName, string MD5)
        {
            int iRow = reader.ReadInt32();          //行数

            if (reader.ReadString() != MD5)         //验证文件MD5(检测结构是否改变)
            {
                throw new System.Exception("文件[" + fileName + "]版本验证失败");
            }
            int i, j, number;
            {
                number = reader.ReadInt32();        //字段数量
                for (i = 0; i < number; ++i)
                {
                    if (reader.ReadInt8() == 0)     //基础类型
                    {
                        reader.ReadInt8();          //基础类型索引
                        reader.ReadBool();          //是否是数组
                    }
                    else                            //自定义类
                    {
                        reader.ReadString();        //自定义类名称
                        reader.ReadBool();          //是否是数组
                    }
                }
            }
            int customNumber = reader.ReadInt32();  //自定义类数量

            for (i = 0; i < customNumber; ++i)
            {
                reader.ReadString();                //读取自定义类名字
                number = reader.ReadInt32();        //字段数量
                for (j = 0; j < number; ++j)
                {
                    if (reader.ReadInt8() == 0)     //基础类型
                    {
                        reader.ReadInt8();          //基础类型索引
                        reader.ReadBool();          //是否是数组
                    }
                    else                            //自定义类
                    {
                        reader.ReadString();        //自定义类名称
                        reader.ReadBool();          //是否是数组
                    }
                }
            }
            return(iRow);
        }
Пример #4
0
        public static DataSpawn Read(ScorpioReader reader)
        {
            DataSpawn ret = new DataSpawn();

            ret._ID           = reader.ReadInt32();
            ret._TestInt      = reader.ReadInt32();
            ret._TestString   = reader.ReadString();
            ret._TestBool     = reader.ReadBool();
            ret._TestInt2     = Int2.Read(reader);
            ret._TestEnumName = (TestEnum)reader.ReadInt32();
            ret.m_IsInvalid   = ret.IsInvalid_impl();
            return(ret);
        }
Пример #5
0
        public static DataSpawn Read(TableManager tableManager, String fileName, ScorpioReader reader)
        {
            DataSpawn ret = new DataSpawn();

            ret._ID         = reader.ReadInt32();
            ret._TestInt    = reader.ReadInt32();
            ret._TestString = reader.ReadString();
            reader.ReadString();
            ret._TestLanguage = tableManager.getLanguageText(fileName + "_TestLanguage_" + ret._ID);
            ret._TestBool     = reader.ReadBool();
            ret._TestInt2     = Int2.Read(tableManager, fileName, reader);
            ret._TestEnumName = (TestEnum)reader.ReadInt32();
            ret.m_IsInvalid   = ret.IsInvalid_impl();
            return(ret);
        }