Example #1
0
        public void ParseFrom(byte[] buffer, int offset, int size)
        {
            if (buffer == null)
            {
                return;
            }
            ProtoBufferReader reader = new ProtoBufferReader(buffer, offset, size);

            foreach (ProtoBufferObject obj in reader.ProtoBufferObjs)
            {
                switch (obj.FieldNumber)
                {
                case 1:
                    MajorLevelId = obj.Value;
                    break;

                case 2:
                    var subLevelUnlockInfo = new SubLevelUnlockInfo();
                    subLevelUnlockInfo.ParseFrom(obj.Value);
                    SubLevelUnlockInfoList.Add(subLevelUnlockInfo);
                    break;

                case 3:
                    Unlocked = obj.Value;
                    break;

                default:
                    break;
                }
            }
        }
Example #2
0
        public void ParseFrom(byte[] buffer, int offset, int size)
        {
            if (buffer == null)
            {
                return;
            }
            ProtoBufferReader reader = new ProtoBufferReader(buffer, offset, size);

            foreach (ProtoBufferObject obj in reader.ProtoBufferObjs)
            {
                switch (obj.FieldNumber)
                {
                case 1:
                    LevelUp = new LevelUp();
                    LevelUp.ParseFrom(obj.Value);
                    break;

                case 2:
                    EnergyCapacityUp = new EnergyCapacityUp();
                    EnergyCapacityUp.ParseFrom(obj.Value);
                    break;

                case 3:
                    var vegetableUnlock = new VegetableUnlock();
                    vegetableUnlock.ParseFrom(obj.Value);
                    VegetableUnlockList.Add(vegetableUnlock);
                    break;

                case 4:
                    var skillUnlock = new SkillUnlock();
                    skillUnlock.ParseFrom(obj.Value);
                    SkillUnlockList.Add(skillUnlock);
                    break;

                case 5:
                    var majorLevelUnlock = new MajorLevelUnlockInfo();
                    majorLevelUnlock.ParseFrom(obj.Value);
                    MajorLevelUnlockList.Add(majorLevelUnlock);
                    break;

                case 6:
                    var subLevelUnlock = new SubLevelUnlockInfo();
                    subLevelUnlock.ParseFrom(obj.Value);
                    SubLevelUnlockList.Add(subLevelUnlock);
                    break;

                case 7:
                    EquipAppear = new EquipAppear();
                    EquipAppear.ParseFrom(obj.Value);
                    break;

                default:
                    break;
                }
            }
        }