-
Notifications
You must be signed in to change notification settings - Fork 139
/
ActionEvaluation.cs
57 lines (52 loc) · 1.87 KB
/
ActionEvaluation.cs
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
namespace Libplanet.Action
{
/// <summary>
/// A record type to represent an evaluation plan and result of
/// a single action.
/// </summary>
public class ActionEvaluation
{
/// <summary>
/// Creates an <see cref="ActionEvaluation"/> instance
/// with filling properties.
/// </summary>
/// <param name="action">An action to evaluate.</param>
/// <param name="inputContext">An input <see cref="IActionContext"/> to
/// evaluate <paramref name="action"/>.</param>
/// <param name="outputStates">The result states that
/// <paramref name="action"/> makes.</param>
/// <param name="exception">An exception that has risen during evaluating a given
/// <paramref name="action"/>.</param>
public ActionEvaluation(
IAction action,
IActionContext inputContext,
IAccountStateDelta outputStates,
Exception? exception = null)
{
Action = action;
InputContext = inputContext;
OutputStates = outputStates;
Exception = exception;
}
/// <summary>
/// An action to evaluate.
/// </summary>
public IAction Action { get; }
/// <summary>
/// An input <see cref="IActionContext"/> to evaluate
/// <see cref="Action"/>.
/// </summary>
/// <remarks>Its <see cref="IActionContext.Random"/> property
/// is not consumed yet.</remarks>
public IActionContext InputContext { get; }
/// <summary>
/// The result states that <see cref="Action"/> makes.
/// </summary>
public IAccountStateDelta OutputStates { get; }
/// <summary>
/// An exception that had risen during evaluation.
/// </summary>
public Exception? Exception { get; }
}
}