forked from ZeraGmbH/Blockly.Net
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGroupRepeat.cs
More file actions
24 lines (21 loc) · 725 Bytes
/
Copy pathGroupRepeat.cs
File metadata and controls
24 lines (21 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
namespace BlocklyNet.Scripting.Engine;
/// <summary>
/// Former result of a group execution and an option for retry.
/// </summary>
public class GroupRepeat : GroupStatus<GroupRepeat>
{
/// <summary>
/// How to execute the group.
/// </summary>
[NotNull, Required]
public GroupRepeatType Repeat { get; set; }
/// <summary>
/// Convert to a regulat status.
/// </summary>
/// <returns>Regular status.</returns>
public GroupStatus ToStatus()
=> JsonSerializer.Deserialize<GroupStatus>(JsonSerializer.Serialize(this, JsonUtils.JsonSettings), JsonUtils.JsonSettings)!;
}