Exemplo n.º 1
0
 public void Set(CopyUnlockedAchievementByIndexOptions other)
 {
     if (other != null)
     {
         m_ApiVersion     = AchievementsInterface.CopyunlockedachievementbyindexApiLatest;
         UserId           = other.UserId;
         AchievementIndex = other.AchievementIndex;
     }
 }
        /// <summary>
        /// DEPRECATED! Use <see cref="CopyPlayerAchievementByAchievementId" /> instead.
        ///
        /// Fetches an unlocked achievement from a given index.
        /// <seealso cref="Release" />
        /// </summary>
        /// <param name="options">Structure containing the Epic Online Services Account ID and index being accessed</param>
        /// <param name="outAchievement">The unlocked achievement data for the given index, if it exists and is valid, use <see cref="Release" /> when finished</param>
        /// <returns>
        /// <see cref="Result.Success" /> if the information is available and passed out in OutAchievement
        /// <see cref="Result.InvalidParameters" /> if you pass a null pointer for the out parameter
        /// <see cref="Result.NotFound" /> if the unlocked achievement is not found
        /// </returns>
        public Result CopyUnlockedAchievementByIndex(CopyUnlockedAchievementByIndexOptions options, out UnlockedAchievement outAchievement)
        {
            System.IntPtr optionsAddress = new System.IntPtr();
            Helper.TryMarshalSet <CopyUnlockedAchievementByIndexOptionsInternal, CopyUnlockedAchievementByIndexOptions>(ref optionsAddress, options);

            var outAchievementAddress = System.IntPtr.Zero;

            var funcResult = EOS_Achievements_CopyUnlockedAchievementByIndex(InnerHandle, optionsAddress, ref outAchievementAddress);

            Helper.TryMarshalDispose(ref optionsAddress);

            if (Helper.TryMarshalGet <UnlockedAchievementInternal, UnlockedAchievement>(outAchievementAddress, out outAchievement))
            {
                EOS_Achievements_UnlockedAchievement_Release(outAchievementAddress);
            }

            return(funcResult);
        }