Beispiel #1
0
        public SampleDefine GetSampleByID(long ID, SampleDefine def = default(SampleDefine))
        {
            SampleDefine ret;

            if (_SampleByID.TryGetValue(ID, out ret))
            {
                return(ret);
            }

            if (def == default(SampleDefine))
            {
                TableLogger.ErrorLine("GetSampleByID failed, ID: {0}", ID);
            }

            return(def);
        }
Beispiel #2
0
        public SampleDefine GetSampleByName(string Name, SampleDefine def = default(SampleDefine))
        {
            SampleDefine ret;

            if (_SampleByName.TryGetValue(Name, out ret))
            {
                return(ret);
            }

            if (def == default(SampleDefine))
            {
                TableLogger.ErrorLine("GetSampleByName failed, Name: {0}", Name);
            }

            return(def);
        }
Beispiel #3
0
        public static void Deserialize(SampleDefine ins, tabtoy.DataReader reader)
        {
            int tag = -1;

            while (-1 != (tag = reader.ReadTag()))
            {
                switch (tag)
                {
                case 0x20000:
                {
                    ins.ID = reader.ReadInt64();
                }
                break;

                case 0x60001:
                {
                    ins.Name = reader.ReadString();
                }
                break;

                case 0x10002:
                {
                    ins.IconID = reader.ReadInt32();
                }
                break;

                case 0x50003:
                {
                    ins.NumericalRate = reader.ReadFloat();
                }
                break;

                case 0x10004:
                {
                    ins.ItemID = reader.ReadInt32();
                }
                break;

                case 0x10005:
                {
                    ins.BuffID.Add(reader.ReadInt32());
                }
                break;

                case 0x90006:
                {
                    ins.Pos = reader.ReadStruct <Vec2>(Vec2DeserializeHandler);
                }
                break;

                case 0x80007:
                {
                    ins.Type = reader.ReadEnum <ActorType>();
                }
                break;

                case 0x10008:
                {
                    ins.SkillID.Add(reader.ReadInt32());
                }
                break;

                case 0x90009:
                {
                    ins.AttackParam = reader.ReadStruct <AttackParam>(AttackParamDeserializeHandler);
                }
                break;

                case 0x9000a:
                {
                    ins.SingleStruct = reader.ReadStruct <Prop>(PropDeserializeHandler);
                }
                break;

                case 0x9000b:
                {
                    ins.StrStruct.Add(reader.ReadStruct <Prop>(PropDeserializeHandler));
                }
                break;
                }
            }
        }