Пример #1
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;

                case 10: {
                    Id = input.ReadString();
                    break;
                }

                case 16: {
                    Receiver = (global::WUProtos.Enums.BonusReceiver)input.ReadEnum();
                    break;
                }

                case 24: {
                    TargetReward = (global::WUProtos.Enums.BonusTargetReward)input.ReadEnum();
                    break;
                }

                case 37: {
                    Modifier = input.ReadFloat();
                    break;
                }

                case 162: {
                    global::WUProtos.Data.Player.PlayerCountChallengeBonus subBuilder = new global::WUProtos.Data.Player.PlayerCountChallengeBonus();
                    if (bonusKindCase_ == BonusKindOneofCase.PlayerCount)
                    {
                        subBuilder.MergeFrom(PlayerCount);
                    }
                    input.ReadMessage(subBuilder);
                    PlayerCount = subBuilder;
                    break;
                }

                case 170: {
                    global::WUProtos.Data.FastCompletionChallengeBonus subBuilder = new global::WUProtos.Data.FastCompletionChallengeBonus();
                    if (bonusKindCase_ == BonusKindOneofCase.FastCompletion)
                    {
                        subBuilder.MergeFrom(FastCompletion);
                    }
                    input.ReadMessage(subBuilder);
                    FastCompletion = subBuilder;
                    break;
                }

                case 178: {
                    global::WUProtos.Data.RuneLevelChallengeBonus subBuilder = new global::WUProtos.Data.RuneLevelChallengeBonus();
                    if (bonusKindCase_ == BonusKindOneofCase.RuneLevel)
                    {
                        subBuilder.MergeFrom(RuneLevel);
                    }
                    input.ReadMessage(subBuilder);
                    RuneLevel = subBuilder;
                    break;
                }

                case 186: {
                    global::WUProtos.Data.DefeatedMobCountChallengeBonus subBuilder = new global::WUProtos.Data.DefeatedMobCountChallengeBonus();
                    if (bonusKindCase_ == BonusKindOneofCase.DefeatedMobCount)
                    {
                        subBuilder.MergeFrom(DefeatedMobCount);
                    }
                    input.ReadMessage(subBuilder);
                    DefeatedMobCount = subBuilder;
                    break;
                }

                case 194: {
                    global::WUProtos.Data.Player.PlayerRatioChallengeBonus subBuilder = new global::WUProtos.Data.Player.PlayerRatioChallengeBonus();
                    if (bonusKindCase_ == BonusKindOneofCase.PlayerRatio)
                    {
                        subBuilder.MergeFrom(PlayerRatio);
                    }
                    input.ReadMessage(subBuilder);
                    PlayerRatio = subBuilder;
                    break;
                }
                }
            }
        }
Пример #2
0
        public void MergeFrom(ChallengeBonus other)
        {
            if (other == null)
            {
                return;
            }
            if (other.Id.Length != 0)
            {
                Id = other.Id;
            }
            if (other.Receiver != 0)
            {
                Receiver = other.Receiver;
            }
            if (other.TargetReward != 0)
            {
                TargetReward = other.TargetReward;
            }
            if (other.Modifier != 0F)
            {
                Modifier = other.Modifier;
            }
            switch (other.BonusKindCase)
            {
            case BonusKindOneofCase.PlayerCount:
                if (PlayerCount == null)
                {
                    PlayerCount = new global::WUProtos.Data.Player.PlayerCountChallengeBonus();
                }
                PlayerCount.MergeFrom(other.PlayerCount);
                break;

            case BonusKindOneofCase.FastCompletion:
                if (FastCompletion == null)
                {
                    FastCompletion = new global::WUProtos.Data.FastCompletionChallengeBonus();
                }
                FastCompletion.MergeFrom(other.FastCompletion);
                break;

            case BonusKindOneofCase.RuneLevel:
                if (RuneLevel == null)
                {
                    RuneLevel = new global::WUProtos.Data.RuneLevelChallengeBonus();
                }
                RuneLevel.MergeFrom(other.RuneLevel);
                break;

            case BonusKindOneofCase.DefeatedMobCount:
                if (DefeatedMobCount == null)
                {
                    DefeatedMobCount = new global::WUProtos.Data.DefeatedMobCountChallengeBonus();
                }
                DefeatedMobCount.MergeFrom(other.DefeatedMobCount);
                break;

            case BonusKindOneofCase.PlayerRatio:
                if (PlayerRatio == null)
                {
                    PlayerRatio = new global::WUProtos.Data.Player.PlayerRatioChallengeBonus();
                }
                PlayerRatio.MergeFrom(other.PlayerRatio);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }