-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIExecutable.cs
More file actions
32 lines (27 loc) · 1.18 KB
/
IExecutable.cs
File metadata and controls
32 lines (27 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.Collections.Generic;
using System.Threading;
using Cysharp.Threading.Tasks;
namespace Screenplay
{
public interface IExecutable : IBranch, IPrerequisite, IPreviewable
{
/// <inheritdoc cref="IBranch.Followup"/>
new IEnumerable<IExecutable?> Followup();
/// <summary>
/// Run the barebone logic for this action, return the next action to run
/// </summary>
UniTask<IExecutable?> Execute(IEventContext context, Cancellation cancellation);
/// <summary>
/// Applies all the changes <see cref="Execute"/> introduces to the objects it touches,
/// and ensures those objects have those changes re-instated when they are loaded again.
/// </summary>
/// <remarks>
/// Is called by the saving system on each node traversed in the saved session to reload that session's state
/// </remarks>
UniTask Persistence(IEventContext context, Cancellation cancellation);
/// <inheritdoc />
bool IPrerequisite.TestPrerequisite(IEventContext context) => context.Visited(this);
/// <inheritdoc/>
IEnumerable<IBranch?> IBranch.Followup() => Followup();
}
}