internal Invitation AsInvitation()
        {
            Participant participant;

            Invitation.InvType invType = ToInvType(this.Type());
            string             invId   = this.Id();
            int variant = (int)this.Variant();

            using (GooglePlayGames.Native.PInvoke.MultiplayerParticipant participant2 = this.Inviter())
            {
                participant = (participant2 != null) ? participant2.AsParticipant() : null;
            }
            return(new Invitation(invType, invId, participant, variant));
        }
        internal GooglePlayGames.BasicApi.Multiplayer.TurnBasedMatch AsTurnBasedMatch(string selfPlayerId)
        {
            List <Participant> participants         = new List <Participant>();
            string             selfParticipantId    = null;
            string             pendingParticipantId = null;

            using (GooglePlayGames.Native.PInvoke.MultiplayerParticipant participant = this.PendingParticipant())
            {
                if (participant != null)
                {
                    pendingParticipantId = participant.Id();
                }
            }
            IEnumerator <GooglePlayGames.Native.PInvoke.MultiplayerParticipant> enumerator = this.Participants().GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    GooglePlayGames.Native.PInvoke.MultiplayerParticipant current = enumerator.Current;
                    using (current)
                    {
                        using (NativePlayer player = current.Player())
                        {
                            if ((player != null) && player.Id().Equals(selfPlayerId))
                            {
                                selfParticipantId = current.Id();
                            }
                        }
                        participants.Add(current.AsParticipant());
                        continue;
                    }
                }
            }
            finally
            {
                if (enumerator == null)
                {
                }
                enumerator.Dispose();
            }
            return(new GooglePlayGames.BasicApi.Multiplayer.TurnBasedMatch(this.Id(), this.Data(), (this.MatchStatus() == GooglePlayGames.Native.Cwrapper.Types.MatchStatus.COMPLETED) && !this.HasRematchId(), selfParticipantId, participants, this.AvailableAutomatchSlots(), pendingParticipantId, ToTurnStatus(this.MatchStatus()), ToMatchStatus(pendingParticipantId, this.MatchStatus()), this.Variant(), this.Version()));
        }