// /*===============================================================================
// Copyright (C) 2020 PhantomsXR Ltd. All Rights Reserved.
//
// This file is part of the XR-MOD SDK.
//
// The XR-MOD SDK cannot be copied, distributed, or made available to
// third-parties for commercial purposes without written permission of PhantomsXR Ltd.
//
// Contact nswell@phantomsxr.com for licensing requests.
// ===============================================================================*/
namespace Phantom.XRMOD.ActionNotification.Runtime
{
///
/// Defines the contract for an action-based notification center.
/// Supports synchronous and asynchronous notification posting and observing.
///
/// The type of action or delegate used for observers.
public interface IActionNotificationCenter
{
///
/// Registers an observer for a specific notification.
///
/// The action to execute when the notification is posted.
/// The unique identifier for the notification.
void AddObserver(T _action, string _name);
///
/// Unregisters a specific observer from a notification.
///
/// The unique identifier for the notification.
/// The specific action to remove.
void RemoveObserver(string _name, T _action);
///
/// Removes all observers associated with a specific notification name.
///
/// The unique identifier for the notification.
void RemoveObserver(string _name);
///
/// Posts a notification to all registered observers synchronously.
///
/// The unique identifier for the notification.
/// Data associated with the notification.
void PostNotification(string _name, BaseNotificationData _notificationData);
}
}