コード例 #1
0
ファイル: DataTest.cs プロジェクト: skyzhp/ScorpioConversion
        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 TableTest Initialize(TableManager tableManager, string fileName)
        {
            m_dataArray.Clear();
            ScorpioReader reader = new ScorpioReader(TableUtil.GetBuffer(fileName));
            int           iRow   = TableUtil.ReadHead(reader, fileName, FILE_MD5_CODE);

            for (int i = 0; i < iRow; ++i)
            {
                DataTest pData = DataTest.Read(tableManager, fileName, reader);
                if (Contains(pData.ID()))
                {
                    throw new System.Exception("文件[" + fileName + "]有重复项 ID : " + pData.ID());
                }
                m_dataArray.Add(pData.ID(), pData);
            }
            m_count = m_dataArray.Count;
            reader.Close();
            return(this);
        }