示例#1
0
 public void Set(LobbyDetailsCopyAttributeByIndexOptions other)
 {
     if (other != null)
     {
         m_ApiVersion = LobbyDetails.LobbydetailsCopyattributebyindexApiLatest;
         AttrIndex    = other.AttrIndex;
     }
 }
        /// <summary>
        /// <see cref="CopyAttributeByIndex" /> is used to immediately retrieve a copy of a lobby attribute from a given source such as a existing lobby or a search result.
        /// If the call returns an <see cref="Result.Success" /> result, the out parameter, OutAttribute, must be passed to <see cref="LobbyInterface.Release" /> to release the memory associated with it.
        /// <seealso cref="Attribute" />
        /// <seealso cref="LobbyDetailsCopyAttributeByIndexOptions" />
        /// <seealso cref="LobbyInterface.Release" />
        /// </summary>
        /// <param name="options">Structure containing the input parameters</param>
        /// <param name="outAttribute">Out parameter used to receive the <see cref="Attribute" /> structure.</param>
        /// <returns>
        /// <see cref="Result.Success" /> if the information is available and passed out in OutAttribute
        /// <see cref="Result.InvalidParameters" /> if you pass a null pointer for the out parameter
        /// <see cref="Result.IncompatibleVersion" /> if the API version passed in is incorrect
        /// </returns>
        public Result CopyAttributeByIndex(LobbyDetailsCopyAttributeByIndexOptions options, out Attribute outAttribute)
        {
            System.IntPtr optionsAddress = new System.IntPtr();
            Helper.TryMarshalSet <LobbyDetailsCopyAttributeByIndexOptionsInternal, LobbyDetailsCopyAttributeByIndexOptions>(ref optionsAddress, options);

            var outAttributeAddress = System.IntPtr.Zero;

            var funcResult = EOS_LobbyDetails_CopyAttributeByIndex(InnerHandle, optionsAddress, ref outAttributeAddress);

            Helper.TryMarshalDispose(ref optionsAddress);

            if (Helper.TryMarshalGet <AttributeInternal, Attribute>(outAttributeAddress, out outAttribute))
            {
                LobbyInterface.EOS_Lobby_Attribute_Release(outAttributeAddress);
            }

            return(funcResult);
        }