namespace Test.Zinnia.Utility.Mock
{
///
/// Allows listening to a UnityEvent that emits a value and checking if the event was emitted as well as the value that was emitted.
///
/// The type of the emitted value.
public class UnityEventValueListenerMock
{
///
/// Whether the event emitted was received by the listener.
///
public bool Received { get; private set; }
///
/// The received event value.
///
public T Value { get; private set; }
///
/// The Reset method resets the listener state.
///
public virtual void Reset()
{
Received = false;
Value = default;
}
///
/// The callback for the event.
///
/// The event's value.
public virtual void Listen(T value)
{
Received = true;
Value = value;
}
}
}