#nullable enable

namespace IGP.UnitySDK.Models
{
    /// <summary>
    /// Source-independent values supplied to the game for the current runtime process.
    /// </summary>
    public sealed class IGPRuntimeInfo
    {
        private string saveRootPath = string.Empty;
        private bool saveRootPathCommitted;

        internal IGPRuntimeInfo()
        {
        }

        /// <summary>
        /// Gets the save root assigned by the runtime host, or an empty string when unavailable.
        /// </summary>
        public string SaveRootPath => saveRootPath;

        internal void CommitSaveRootPath(string value)
        {
            if (saveRootPathCommitted)
            {
                return;
            }

            saveRootPath = string.IsNullOrWhiteSpace(value) ? string.Empty : value;
            saveRootPathCommitted = true;
        }
    }
}
