Esempio n. 1
0
 public void Set(CopyStatByNameOptions other)
 {
     if (other != null)
     {
         m_ApiVersion = StatsInterface.CopystatbynameApiLatest;
         TargetUserId = other.TargetUserId;
         Name         = other.Name;
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Fetches a stat from cached stats by name. Use <see cref="Release" /> when finished with the data.
        /// <seealso cref="Release" />
        /// </summary>
        /// <param name="options">Structure containing the Epic Online Services Account ID and name being accessed</param>
        /// <param name="outStat">The stat data for the given name, if it exists and is valid</param>
        /// <returns>
        /// <see cref="Result.Success" /> if the information is available and passed out in OutStat
        /// <see cref="Result.InvalidParameters" /> if you pass a null pointer for the out parameter
        /// <see cref="Result.NotFound" /> if the stat is not found
        /// </returns>
        public Result CopyStatByName(CopyStatByNameOptions options, out Stat outStat)
        {
            System.IntPtr optionsAddress = new System.IntPtr();
            Helper.TryMarshalSet <CopyStatByNameOptionsInternal, CopyStatByNameOptions>(ref optionsAddress, options);

            var outStatAddress = System.IntPtr.Zero;

            var funcResult = EOS_Stats_CopyStatByName(InnerHandle, optionsAddress, ref outStatAddress);

            Helper.TryMarshalDispose(ref optionsAddress);

            if (Helper.TryMarshalGet <StatInternal, Stat>(outStatAddress, out outStat))
            {
                EOS_Stats_Stat_Release(outStatAddress);
            }

            return(funcResult);
        }