public void Set(CopyModInfoOptions other)
 {
     if (other != null)
     {
         m_ApiVersion = ModsInterface.CopymodinfoApiLatest;
         LocalUserId  = other.LocalUserId;
         Type         = other.Type;
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Get cached enumerated mods object. If successful, this data must be released by calling <see cref="Release" />
        /// Types of the cached enumerated mods can be specified through <see cref="CopyModInfoOptions" />
        /// <seealso cref="Release" />
        /// This request may fail with an <seealso cref="Result.NotFound" /> code if an enumeration of a certain type was not performed before this call.
        /// </summary>
        /// <param name="options">structure containing the game identifier for which requesting enumerated mods</param>
        /// <param name="outEnumeratedMods">Enumerated mods Info. If the returned result is success, this will be set to data that must be later released, otherwise this will be set to NULL</param>
        /// <returns>
        /// Success if we have cached data, or an error result if the request was invalid or we do not have cached data.
        /// </returns>
        public Result CopyModInfo(CopyModInfoOptions options, out ModInfo outEnumeratedMods)
        {
            System.IntPtr optionsAddress = new System.IntPtr();
            Helper.TryMarshalSet <CopyModInfoOptionsInternal, CopyModInfoOptions>(ref optionsAddress, options);

            var outEnumeratedModsAddress = System.IntPtr.Zero;

            var funcResult = EOS_Mods_CopyModInfo(InnerHandle, optionsAddress, ref outEnumeratedModsAddress);

            Helper.TryMarshalDispose(ref optionsAddress);

            if (Helper.TryMarshalGet <ModInfoInternal, ModInfo>(outEnumeratedModsAddress, out outEnumeratedMods))
            {
                EOS_Mods_ModInfo_Release(outEnumeratedModsAddress);
            }

            return(funcResult);
        }