Exemplo n.º 1
0
        public void MergeFrom(Match other)
        {
            if (other == null)
            {
                return;
            }
            if (other.Guid.Length != 0)
            {
                Guid = other.Guid;
            }
            players_.Add(other.players_);
            if (other.selectedLevel_ != null)
            {
                if (selectedLevel_ == null)
                {
                    SelectedLevel = new global::TournamentAssistantShared.Models.PreviewBeatmapLevel();
                }
                SelectedLevel.MergeFrom(other.SelectedLevel);
            }
            if (other.selectedCharacteristic_ != null)
            {
                if (selectedCharacteristic_ == null)
                {
                    SelectedCharacteristic = new global::TournamentAssistantShared.Models.Characteristic();
                }
                SelectedCharacteristic.MergeFrom(other.SelectedCharacteristic);
            }
            if (other.SelectedDifficulty != global::TournamentAssistantShared.Models.BeatmapDifficulty.Easy)
            {
                SelectedDifficulty = other.SelectedDifficulty;
            }
            switch (other.LeaderCase)
            {
            case LeaderOneofCase.Coordinator:
                if (Coordinator == null)
                {
                    Coordinator = new global::TournamentAssistantShared.Models.Coordinator();
                }
                Coordinator.MergeFrom(other.Coordinator);
                break;

            case LeaderOneofCase.Player:
                if (Player == null)
                {
                    Player = new global::TournamentAssistantShared.Models.Player();
                }
                Player.MergeFrom(other.Player);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
Exemplo n.º 2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Guid.Length != 0)
            {
                hash ^= Guid.GetHashCode();
            }
            hash ^= players_.GetHashCode();
            if (leaderCase_ == LeaderOneofCase.Coordinator)
            {
                hash ^= Coordinator.GetHashCode();
            }
            if (leaderCase_ == LeaderOneofCase.Player)
            {
                hash ^= Player.GetHashCode();
            }
            if (selectedLevel_ != null)
            {
                hash ^= SelectedLevel.GetHashCode();
            }
            if (selectedCharacteristic_ != null)
            {
                hash ^= SelectedCharacteristic.GetHashCode();
            }
            if (SelectedDifficulty != global::TournamentAssistantShared.Models.BeatmapDifficulty.Easy)
            {
                hash ^= SelectedDifficulty.GetHashCode();
            }
            hash ^= (int)leaderCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }