Пример #1
0
        public void ParseDataRow(string dataRowText)
        {
            //使用\t分割
            string[] text = DataTableExtension.SplitDataRow(dataRowText);
            //这里有一个坑
            Id    = _id++;
            Id_Id = text[0];
            string[] ids = Id_Id.Split('_');
            int      tid = int.Parse(ids[0]);


            cId = text[1];
            if (!cId.Equals("200") && !cId.Equals("100"))
            {
                if (allDictionary.ContainsKey(tid))
                {
                    allDictionary[tid].AddSynFun(int.Parse(ids[1]), int.Parse(cId));
                }
                else
                {
                    MonIdAndCounts tmp = new MonIdAndCounts();
                    tmp.AddSynFun(int.Parse(ids[1]), int.Parse(cId));
                    allDictionary.Add(tid, tmp);
                }
            }
        }
Пример #2
0
 public void ParseDataRow(string dataRowText)
 {
     //使用\t分割
     string[] text = DataTableExtension.SplitDataRow(dataRowText);
     //这里有一个坑
     Id    = int.Parse(text[1]);
     Key   = text[2];
     Value = text[3];
 }
Пример #3
0
        public void ParseDataRow(string dataRowText)
        {
            string[] text  = DataTableExtension.SplitDataRow(dataRowText);
            int      index = 0;

            index++;
            Id = int.Parse(text[index++]);
            index++;
            AssetName = text[index++];
        }
Пример #4
0
        public void ParseDataRow(string dataRowText)
        {
            string[] text  = DataTableExtension.SplitDataRow(dataRowText);
            int      index = 0;

            index++;
            Id = int.Parse(text[index++]);
            index++;
            Speed = float.Parse(text[index++]);
        }
Пример #5
0
        /*public override void ParseDataRow(string dataRowSegment)
         * {
         *  string[] text = DataTableExtension.SplitDataRow(dataRowSegment);
         *  int index = 0;
         *  index++;
         *  m_Id = int.Parse(text[index++]);
         *  index++;
         *  AssetName = text[index++];
         *  BackgroundMusicId = int.Parse(text[index++]);
         * }*/

        public void ParseRowData(string dataRowSegment)
        {
            string[] text  = DataTableExtension.SplitDataRow(dataRowSegment);
            int      index = 0;

            index++;
            m_Id = int.Parse(text[index++]);
            index++;
            AssetName         = text[index++];
            BackgroundMusicId = int.Parse(text[index++]);
        }
Пример #6
0
        public void ParseDataRow(string dataRowText)
        {
            string[] text  = DataTableExtension.SplitDataRow(dataRowText);
            int      index = 0;

            index++;
            Id = int.Parse(text[index++]);
            index++;
            MaxHP   = int.Parse(text[index++]);
            Defense = int.Parse(text[index++]);
        }
Пример #7
0
        public void ParseDataRow(string dataRowText)
        {
            string[] text  = DataTableExtension.SplitDataRow(dataRowText);
            int      index = 0;

            index++;
            Id = int.Parse(text[index++]);
            index++;
            AssetName          = text[index++];
            UIGroupName        = text[index++];
            PauseCoveredUIForm = bool.Parse(text[index++]);
        }
Пример #8
0
        public override bool ParseDataRow(GameFrameworkSegment <string> dataRowSegment)
        {
            string[] text  = DataTableExtension.SplitDataRow(dataRowSegment);
            int      index = 0;

            index++;
            m_Id = int.Parse(text[index++]);
            index++;
            AssetName = text[index++];

            return(true);
        }
Пример #9
0
        public void ParseDataRow(string dataRowText)
        {
            string[] text  = DataTableExtension.SplitDataRow(dataRowText);
            int      index = 0;

            index++;
            Id = int.Parse(text[index++]);
            index++;
            Attack         = int.Parse(text[index++]);
            AttackInterval = float.Parse(text[index++]);
            BulletId       = int.Parse(text[index++]);
            BulletSpeed    = float.Parse(text[index++]);
            BulletSoundId  = int.Parse(text[index++]);
        }
Пример #10
0
        public void ParseDataRow(string dataRowText)
        {
            string[] text  = DataTableExtension.SplitDataRow(dataRowText);
            int      index = 0;

            index++;
            Id = int.Parse(text[index++]);
            index++;
            AssetName    = text[index++];
            Priority     = int.Parse(text[index++]);
            Loop         = bool.Parse(text[index++]);
            Volume       = float.Parse(text[index++]);
            SpatialBlend = float.Parse(text[index++]);
            MaxDistance  = float.Parse(text[index++]);
        }
Пример #11
0
        public void ParseDataRow(string dataRowText)
        {
            string[] text  = DataTableExtension.SplitDataRow(dataRowText);
            int      index = 0;

            index++;
            Id = int.Parse(text[index++]);
            index++;
            MaxHP        = int.Parse(text[index++]);
            Attack       = int.Parse(text[index++]);
            Speed        = float.Parse(text[index++]);
            AngularSpeed = float.Parse(text[index++]);
            DeadEffectId = int.Parse(text[index++]);
            DeadSoundId  = int.Parse(text[index++]);
        }
Пример #12
0
        public override bool ParseDataRow(GameFrameworkSegment <string> dataRowSegment)
        {
            string[] text  = DataTableExtension.SplitDataRow(dataRowSegment);
            int      index = 0;

            index++;
            m_Id = int.Parse(text[index++]);
            index++;
            AssetName          = text[index++];
            UIGroupName        = text[index++];
            AllowMultiInstance = bool.Parse(text[index++]);
            PauseCoveredUIForm = bool.Parse(text[index++]);

            return(true);
        }
Пример #13
0
        public override bool ParseDataRow(GameFrameworkSegment <string> dataRowSegment)
        {
            string[] text  = DataTableExtension.SplitDataRow(dataRowSegment);
            int      index = 0;

            index++;
            m_Id = int.Parse(text[index++]);
            index++;
            Attack         = int.Parse(text[index++]);
            AttackInterval = float.Parse(text[index++]);
            BulletId       = int.Parse(text[index++]);
            BulletSpeed    = float.Parse(text[index++]);
            BulletSoundId  = int.Parse(text[index++]);

            return(true);
        }
Пример #14
0
        public override bool ParseDataRow(GameFrameworkSegment <string> dataRowSegment)
        {
            string[] text  = DataTableExtension.SplitDataRow(dataRowSegment);
            int      index = 0;

            index++;
            m_Id = int.Parse(text[index++]);
            index++;
            MaxHP        = int.Parse(text[index++]);
            Attack       = int.Parse(text[index++]);
            Speed        = float.Parse(text[index++]);
            AngularSpeed = float.Parse(text[index++]);
            DeadEffectId = int.Parse(text[index++]);
            DeadSoundId  = int.Parse(text[index++]);

            return(true);
        }
Пример #15
0
        public override bool ParseDataRow(GameFrameworkSegment <string> dataRowSegment)
        {
            string[] text  = DataTableExtension.SplitDataRow(dataRowSegment);
            int      index = 0;

            index++;
            m_Id = int.Parse(text[index++]);
            index++;
            AssetName    = text[index++];
            Priority     = int.Parse(text[index++]);
            Loop         = bool.Parse(text[index++]);
            Volume       = float.Parse(text[index++]);
            SpatialBlend = float.Parse(text[index++]);
            MaxDistance  = float.Parse(text[index++]);

            return(true);
        }
Пример #16
0
        public void ParseDataRow(string dataRowText)
        {
            //使用\t分割
            string[] text = DataTableExtension.SplitDataRow(dataRowText);
            //这里有一个坑
            Id       = int.Parse(text[0]);
            BName    = text[1];
            intro    = text[2];
            asset    = text[3];
            endValue = int.Parse(text[4]);
            string tmp = text[5];

            if (tmp == "")
            {
                tmp = "6";
            }
            soundId = int.Parse(tmp);
        }
Пример #17
0
        public void ParseRowData(string dataRowSegment)
        {
            string[] text  = DataTableExtension.SplitDataRow(dataRowSegment);
            int      index = 0;

            index++;
            m_Id = int.Parse(text[index++]);
            index++;
            ThrusterId = int.Parse(text[index++]);
            for (int i = 0; i < MaxWeaponCount; i++)
            {
                m_WeaponIds[i] = int.Parse(text[index++]);
            }
            for (int i = 0; i < MaxArmorCount; i++)
            {
                m_ArmorIds[i] = int.Parse(text[index++]);
            }
            DeadEffectId = int.Parse(text[index++]);
            DeadSoundId  = int.Parse(text[index++]);
        }
Пример #18
0
        public override bool ParseDataRow(GameFrameworkSegment <string> dataRowSegment)
        {
            // Star Force 示例代码,正式项目使用时请调整此处的生成代码,以处理 GCAlloc 问题!
            string[] columnTexts = dataRowSegment.Source.Substring(dataRowSegment.Offset, dataRowSegment.Length).Split(DataTableExtension.DataSplitSeparators);
            for (int i = 0; i < columnTexts.Length; i++)
            {
                columnTexts[i] = columnTexts[i].Trim(DataTableExtension.DataTrimSeparators);
            }

            int index = 0;

            index++;
            m_Id = int.Parse(columnTexts[index++]);
            index++;
            BoolValue    = bool.Parse(columnTexts[index++]);
            ByteValue    = byte.Parse(columnTexts[index++]);
            CharValue    = char.Parse(columnTexts[index++]);
            Color32Value = DataTableExtension.ParseColor32(columnTexts[index++]);
            ColorValue   = DataTableExtension.ParseColor(columnTexts[index++]);
            index++;
            DateTimeValue   = DateTime.Parse(columnTexts[index++]);
            DecimalValue    = decimal.Parse(columnTexts[index++]);
            DoubleValue     = double.Parse(columnTexts[index++]);
            FloatValue      = float.Parse(columnTexts[index++]);
            IntValue        = int.Parse(columnTexts[index++]);
            LongValue       = long.Parse(columnTexts[index++]);
            QuaternionValue = DataTableExtension.ParseQuaternion(columnTexts[index++]);
            RectValue       = DataTableExtension.ParseRect(columnTexts[index++]);
            SByteValue      = sbyte.Parse(columnTexts[index++]);
            ShortValue      = short.Parse(columnTexts[index++]);
            StringValue     = columnTexts[index++];
            UIntValue       = uint.Parse(columnTexts[index++]);
            ULongValue      = ulong.Parse(columnTexts[index++]);
            UShortValue     = ushort.Parse(columnTexts[index++]);
            Vector2Value    = DataTableExtension.ParseVector2(columnTexts[index++]);
            Vector3Value    = DataTableExtension.ParseVector3(columnTexts[index++]);
            Vector4Value    = DataTableExtension.ParseVector4(columnTexts[index++]);

            GeneratePropertyArray();
            return(true);
        }
Пример #19
0
        public override bool ParseDataRow(string dataRowString, object userData)
        {
            string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators);
            for (int i = 0; i < columnStrings.Length; i++)
            {
                columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators);
            }

            int index = 0;

            index++;
            m_Id = int.Parse(columnStrings[index++]);
            index++;
            BoolValue    = bool.Parse(columnStrings[index++]);
            ByteValue    = byte.Parse(columnStrings[index++]);
            CharValue    = char.Parse(columnStrings[index++]);
            Color32Value = DataTableExtension.ParseColor32(columnStrings[index++]);
            ColorValue   = DataTableExtension.ParseColor(columnStrings[index++]);
            index++;
            DateTimeValue   = DateTime.Parse(columnStrings[index++]);
            DecimalValue    = decimal.Parse(columnStrings[index++]);
            DoubleValue     = double.Parse(columnStrings[index++]);
            FloatValue      = float.Parse(columnStrings[index++]);
            IntValue        = int.Parse(columnStrings[index++]);
            LongValue       = long.Parse(columnStrings[index++]);
            QuaternionValue = DataTableExtension.ParseQuaternion(columnStrings[index++]);
            RectValue       = DataTableExtension.ParseRect(columnStrings[index++]);
            SByteValue      = sbyte.Parse(columnStrings[index++]);
            ShortValue      = short.Parse(columnStrings[index++]);
            StringValue     = columnStrings[index++];
            UIntValue       = uint.Parse(columnStrings[index++]);
            ULongValue      = ulong.Parse(columnStrings[index++]);
            UShortValue     = ushort.Parse(columnStrings[index++]);
            Vector2Value    = DataTableExtension.ParseVector2(columnStrings[index++]);
            Vector3Value    = DataTableExtension.ParseVector3(columnStrings[index++]);
            Vector4Value    = DataTableExtension.ParseVector4(columnStrings[index++]);

            GeneratePropertyArray();
            return(true);
        }
Пример #20
0
        public override bool ParseDataRow(GameFrameworkSegment <string> dataRowSegment)
        {
            string[] text  = DataTableExtension.SplitDataRow(dataRowSegment);
            int      index = 0;

            index++;
            m_Id = int.Parse(text[index++]);
            index++;
            ThrusterId = int.Parse(text[index++]);
            for (int i = 0; i < MaxWeaponCount; i++)
            {
                m_WeaponIds[i] = int.Parse(text[index++]);
            }
            for (int i = 0; i < MaxArmorCount; i++)
            {
                m_ArmorIds[i] = int.Parse(text[index++]);
            }
            DeadEffectId = int.Parse(text[index++]);
            DeadSoundId  = int.Parse(text[index++]);

            return(true);
        }
Пример #21
0
        public override bool ParseDataRow(GameFrameworkDataSegment dataRowSegment, object dataTableUserData)
        {
            Type dataType = dataRowSegment.DataType;

            if (dataType == typeof(string))
            {
                string[] columnTexts = ((string)dataRowSegment.Data).Substring(dataRowSegment.Offset, dataRowSegment.Length).Split(DataTableExtension.DataSplitSeparators);
                for (int i = 0; i < columnTexts.Length; i++)
                {
                    columnTexts[i] = columnTexts[i].Trim(DataTableExtension.DataTrimSeparators);
                }

                int index = 0;
                index++;
                m_Id = int.Parse(columnTexts[index++]);
                index++;
                BoolValue    = bool.Parse(columnTexts[index++]);
                ByteValue    = byte.Parse(columnTexts[index++]);
                CharValue    = char.Parse(columnTexts[index++]);
                Color32Value = DataTableExtension.ParseColor32(columnTexts[index++]);
                ColorValue   = DataTableExtension.ParseColor(columnTexts[index++]);
                index++;
                DateTimeValue   = DateTime.Parse(columnTexts[index++]);
                DecimalValue    = decimal.Parse(columnTexts[index++]);
                DoubleValue     = double.Parse(columnTexts[index++]);
                FloatValue      = float.Parse(columnTexts[index++]);
                IntValue        = int.Parse(columnTexts[index++]);
                LongValue       = long.Parse(columnTexts[index++]);
                QuaternionValue = DataTableExtension.ParseQuaternion(columnTexts[index++]);
                RectValue       = DataTableExtension.ParseRect(columnTexts[index++]);
                SByteValue      = sbyte.Parse(columnTexts[index++]);
                ShortValue      = short.Parse(columnTexts[index++]);
                StringValue     = columnTexts[index++];
                UIntValue       = uint.Parse(columnTexts[index++]);
                ULongValue      = ulong.Parse(columnTexts[index++]);
                UShortValue     = ushort.Parse(columnTexts[index++]);
                Vector2Value    = DataTableExtension.ParseVector2(columnTexts[index++]);
                Vector3Value    = DataTableExtension.ParseVector3(columnTexts[index++]);
                Vector4Value    = DataTableExtension.ParseVector4(columnTexts[index++]);
            }
            else if (dataType == typeof(byte[]))
            {
                string[] strings = (string[])dataTableUserData;
                using (MemoryStream memoryStream = new MemoryStream((byte[])dataRowSegment.Data, dataRowSegment.Offset, dataRowSegment.Length, false))
                {
                    using (BinaryReader binaryReader = new BinaryReader(memoryStream, Encoding.UTF8))
                    {
                        m_Id            = binaryReader.Read7BitEncodedInt32();
                        BoolValue       = binaryReader.ReadBoolean();
                        ByteValue       = binaryReader.ReadByte();
                        CharValue       = binaryReader.ReadChar();
                        Color32Value    = binaryReader.ReadColor32();
                        ColorValue      = binaryReader.ReadColor();
                        DateTimeValue   = binaryReader.ReadDateTime();
                        DecimalValue    = binaryReader.ReadDecimal();
                        DoubleValue     = binaryReader.ReadDouble();
                        FloatValue      = binaryReader.ReadSingle();
                        IntValue        = binaryReader.Read7BitEncodedInt32();
                        LongValue       = binaryReader.Read7BitEncodedInt64();
                        QuaternionValue = binaryReader.ReadQuaternion();
                        RectValue       = binaryReader.ReadRect();
                        SByteValue      = binaryReader.ReadSByte();
                        ShortValue      = binaryReader.ReadInt16();
                        StringValue     = strings[binaryReader.Read7BitEncodedInt32()];
                        UIntValue       = binaryReader.Read7BitEncodedUInt32();
                        ULongValue      = binaryReader.Read7BitEncodedUInt64();
                        UShortValue     = binaryReader.ReadUInt16();
                        Vector2Value    = binaryReader.ReadVector2();
                        Vector3Value    = binaryReader.ReadVector3();
                        Vector4Value    = binaryReader.ReadVector4();
                    }
                }
            }
            else
            {
                Log.Warning("Can not parse data row which type '{0}' is invalid.", dataType.FullName);
                return(false);
            }

            GeneratePropertyArray();
            return(true);
        }