namespace adas_core.Domain.Utils;

/// <summary>
/// Provides static access to global application data and configuration values.
/// </summary>
public static class GlobalData
{
    public static Dictionary<string, object> Data = new();

    /// <summary>
    /// Adds or updates a key-value pair in the data store. If the key already exists, its value is replaced; otherwise, a new entry is created.
    /// </summary>
    /// <param name="key">The key used to identify the data entry in the store.</param>
    /// <param name="value">The value to associate with the specified key.</param>
    public static void AddData(string key, object value)
        {
            var exists = Data.ContainsKey(key);
            if (exists)
                Data[key] = value;
            else
                Data.Add(key, value);
        }
}