コード例 #1
0
 public Rune(string name, RuneType type, RuneLevel level, string description)
 {
     Id          = Guid.NewGuid();
     Name        = name;
     Type        = type;
     this.level  = level;
     Description = description;
 }
コード例 #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (Receiver != 0)
            {
                hash ^= Receiver.GetHashCode();
            }
            if (TargetReward != 0)
            {
                hash ^= TargetReward.GetHashCode();
            }
            if (Modifier != 0F)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Modifier);
            }
            if (bonusKindCase_ == BonusKindOneofCase.PlayerCount)
            {
                hash ^= PlayerCount.GetHashCode();
            }
            if (bonusKindCase_ == BonusKindOneofCase.FastCompletion)
            {
                hash ^= FastCompletion.GetHashCode();
            }
            if (bonusKindCase_ == BonusKindOneofCase.RuneLevel)
            {
                hash ^= RuneLevel.GetHashCode();
            }
            if (bonusKindCase_ == BonusKindOneofCase.DefeatedMobCount)
            {
                hash ^= DefeatedMobCount.GetHashCode();
            }
            if (bonusKindCase_ == BonusKindOneofCase.PlayerRatio)
            {
                hash ^= PlayerRatio.GetHashCode();
            }
            hash ^= (int)bonusKindCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #3
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);
        }