Add project files.
This commit is contained in:
14
Assets/Cryville/Common/AsyncDelivery.cs
Normal file
14
Assets/Cryville/Common/AsyncDelivery.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user