Beispiel #1
0
        public TestDefine GetTestByID(int ID, TestDefine def = default(TestDefine))
        {
            TestDefine ret;

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

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

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

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

                case 0x10001:
                {
                    ins.TestInt = reader.ReadInt32();
                }
                break;

                case 0x20002:
                {
                    ins.TestLong = reader.ReadInt64();
                }
                break;

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

                case 0x60004:
                {
                    ins.TestString = reader.ReadString();
                }
                break;

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

                case 0x50006:
                {
                    ins.TestFloat2 = reader.ReadFloat();
                }
                break;

                case 0x60007:
                {
                    ins.TestStringArr.Add(reader.ReadString());
                }
                break;

                case 0x80008:
                {
                    ins.TestEnum0 = (SkillTriggerType)reader.ReadInt32();
                }
                break;

                case 0x80009:
                {
                    ins.TestEnum1 = (SkillTriggerType)reader.ReadInt32();
                }
                break;

                case 0x9000a:
                {
                    ins.TestClass = reader.ReadStruct <DropShow>(DropShowDeserializeHandler);
                }
                break;

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