83 lines
2.0 KiB
C#
83 lines
2.0 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace RecRoom
|
|
{
|
|
// Token: 0x0200113D RID: 4413
|
|
public sealed class ActionEvent<T, U, V> : ListEvent<Action<T, U, V>>
|
|
{
|
|
// Token: 0x06025BCC RID: 154572 RVA: 0x00A78A0C File Offset: 0x00A76C0C
|
|
public ActionEvent(int capacity = 32, bool useTryCatch = false)
|
|
: base(capacity, useTryCatch)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06025BCD RID: 154573 RVA: 0x00A78A18 File Offset: 0x00A76C18
|
|
public void Invoke(T t, U u, V v)
|
|
{
|
|
object actionList = this.actionList;
|
|
lock (actionList)
|
|
{
|
|
try
|
|
{
|
|
this.isIterating = true;
|
|
if (this.useTryCatch)
|
|
{
|
|
for (int i = 0; i < this.actionList.Count; i++)
|
|
{
|
|
try
|
|
{
|
|
this.actionList[i](t, u, v);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Debug.LogException(ex);
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
for (int j = 0; j < this.actionList.Count; j++)
|
|
{
|
|
this.actionList[j](t, u, v);
|
|
}
|
|
}
|
|
}
|
|
finally
|
|
{
|
|
base.ProcessQueuedModifications();
|
|
this.isIterating = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06025BCE RID: 154574 RVA: 0x00A78B04 File Offset: 0x00A76D04
|
|
public override void DynamicInvoke(object[] args)
|
|
{
|
|
if (args == null)
|
|
{
|
|
throw new ArgumentException("Null arguments passed to ActionEvent.Invoke()");
|
|
}
|
|
if (args.Length != 3)
|
|
{
|
|
throw new ArgumentException("Invalid number of arguments passed to ActionEvent.Invoke()");
|
|
}
|
|
this.Invoke((T)((object)args[0]), (U)((object)args[1]), (V)((object)args[2]));
|
|
}
|
|
|
|
// Token: 0x06025BCF RID: 154575 RVA: 0x00A78B54 File Offset: 0x00A76D54
|
|
public static ActionEvent<T, U, V>operator +(ActionEvent<T, U, V> actionEvent, Action<T, U, V> action)
|
|
{
|
|
actionEvent.Add(action);
|
|
return actionEvent;
|
|
}
|
|
|
|
// Token: 0x06025BD0 RID: 154576 RVA: 0x00A78B60 File Offset: 0x00A76D60
|
|
public static ActionEvent<T, U, V>operator -(ActionEvent<T, U, V> actionEvent, Action<T, U, V> action)
|
|
{
|
|
actionEvent.Remove(action);
|
|
return actionEvent;
|
|
}
|
|
}
|
|
}
|