-
Notifications
You must be signed in to change notification settings - Fork 33
/
SrGameFilter.cs
87 lines (75 loc) 路 3.1 KB
/
SrGameFilter.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
锘縰sing NSwag.Annotations;
using Tzkt.Api.Services;
namespace Tzkt.Api
{
public class SrGameFilter : INormalizable
{
/// <summary>
/// Filter by internal TzKT id.
/// Click on the parameter to expand more details.
/// </summary>
public Int32Parameter id { get; set; }
/// <summary>
/// Filter by smart rollup.
/// Click on the parameter to expand more details.
/// </summary>
public AccountParameter rollup { get; set; }
/// <summary>
/// Filter by initiator (who found a wrong commitment and started the refutation game).
/// Click on the parameter to expand more details.
/// </summary>
public AccountParameter initiator { get; set; }
/// <summary>
/// Filter by initiator's commitment
/// </summary>
public SrCommitmentInfoFilter initiatorCommitment { get; set; }
/// <summary>
/// Filter by opponent (who was accused in publishing a wrong commitment).
/// Click on the parameter to expand more details.
/// </summary>
public AccountParameter opponent { get; set; }
/// <summary>
/// Filter by opponent's commitment
/// </summary>
public SrCommitmentInfoFilter opponentCommitment { get; set; }
/// <summary>
/// Filter by level of the block, where the refutation game was started.
/// Click on the parameter to expand more details.
/// </summary>
public Int32Parameter firstLevel { get; set; }
/// <summary>
/// Filter by timestamp of the block, where the refutation game was started.
/// Click on the parameter to expand more details.
/// </summary>
public TimestampParameter firstTime { get; set; }
/// <summary>
/// Filter by level of the block, where the refutation game was last updated.
/// Click on the parameter to expand more details.
/// </summary>
public Int32Parameter lastLevel { get; set; }
/// <summary>
/// Filter by timestamp of the block, where the refutation game was last updated.
/// Click on the parameter to expand more details.
/// </summary>
public TimestampParameter lastTime { get; set; }
[OpenApiIgnore]
public bool Empty =>
id == null &&
rollup == null &&
initiator == null &&
initiatorCommitment.Empty &&
opponent == null &&
opponentCommitment.Empty &&
firstLevel == null &&
firstTime == null &&
lastLevel == null &&
lastTime == null;
public string Normalize(string name)
{
return ResponseCacheService.BuildKey("",
("id", id), ("rollup", rollup), ("initiator", initiator), ("initiatorCommitment", initiatorCommitment),
("opponent", opponent), ("opponentCommitment", opponentCommitment), ("firstLevel", firstLevel),
("firstTime", firstTime), ("lastLevel", lastLevel), ("lastTime", lastTime));
}
}
}