Files
crtr/Assets/Cryville/Common/AsyncDelivery.cs
2022-09-30 17:32:21 +08:00

15 lines
382 B
C#

using System;
namespace Cryville.Common {
public class AsyncDelivery<T> {
public Action CancelSource { private get; set; }
public Action<bool, T> Destination { private get; set; }
public void Deliver(bool succeeded, T result) {
if (Destination != null) Destination(succeeded, result);
}
public void Cancel() {
if (CancelSource != null) CancelSource();
}
}
}