Esempio n. 1
0
 public void Set(CopyPlayerAchievementByAchievementIdOptions other)
 {
     if (other != null)
     {
         m_ApiVersion  = AchievementsInterface.CopyplayerachievementbyachievementidApiLatest;
         UserId        = other.UserId;
         AchievementId = other.AchievementId;
     }
 }
        /// <summary>
        /// Fetches a player achievement from a given achievement ID.
        /// <seealso cref="Release" />
        /// </summary>
        /// <param name="options">Structure containing the Epic Online Services Account ID and achievement ID being accessed</param>
        /// <param name="outAchievement">The player achievement data for the given achievement ID, 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 player achievement is not found
        /// <see cref="Result.InvalidProductUserID" /> if you pass an invalid user ID
        /// </returns>
        public Result CopyPlayerAchievementByAchievementId(CopyPlayerAchievementByAchievementIdOptions options, out PlayerAchievement outAchievement)
        {
            System.IntPtr optionsAddress = new System.IntPtr();
            Helper.TryMarshalSet <CopyPlayerAchievementByAchievementIdOptionsInternal, CopyPlayerAchievementByAchievementIdOptions>(ref optionsAddress, options);

            var outAchievementAddress = System.IntPtr.Zero;

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

            Helper.TryMarshalDispose(ref optionsAddress);

            if (Helper.TryMarshalGet <PlayerAchievementInternal, PlayerAchievement>(outAchievementAddress, out outAchievement))
            {
                EOS_Achievements_PlayerAchievement_Release(outAchievementAddress);
            }

            return(funcResult);
        }