2024-02-19 14:20:12 +00:00
|
|
|
|
namespace Utils
|
|
|
|
|
{
|
2024-03-27 14:39:42 +00:00
|
|
|
|
public class BlockInterval
|
2024-02-19 14:20:12 +00:00
|
|
|
|
{
|
2024-05-31 08:16:57 +00:00
|
|
|
|
public BlockInterval(TimeRange timeRange, ulong from, ulong to)
|
2024-02-19 14:20:12 +00:00
|
|
|
|
{
|
|
|
|
|
if (from < to)
|
|
|
|
|
{
|
|
|
|
|
From = from;
|
|
|
|
|
To = to;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
From = to;
|
|
|
|
|
To = from;
|
|
|
|
|
}
|
2024-05-31 08:16:57 +00:00
|
|
|
|
TimeRange = timeRange;
|
2024-11-04 11:21:39 +00:00
|
|
|
|
NumberOfBlocks = (To - From) + 1;
|
2024-02-19 14:20:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ulong From { get; }
|
|
|
|
|
public ulong To { get; }
|
2024-05-31 08:16:57 +00:00
|
|
|
|
public TimeRange TimeRange { get; }
|
2024-11-04 11:21:39 +00:00
|
|
|
|
public ulong NumberOfBlocks { get; }
|
2024-02-19 14:41:48 +00:00
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return $"[{From} - {To}]";
|
|
|
|
|
}
|
2024-02-19 14:20:12 +00:00
|
|
|
|
}
|
|
|
|
|
}
|