forked from crskycode/BCnEncoder.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgressElement.cs
More file actions
31 lines (27 loc) · 753 Bytes
/
Copy pathProgressElement.cs
File metadata and controls
31 lines (27 loc) · 753 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
25
26
27
28
29
30
31
namespace BCnEncoder.Shared
{
public struct ProgressElement
{
/// <summary>
/// Current block being processed
/// </summary>
public int CurrentBlock { get; }
/// <summary>
/// The total amount of blocks to be processed
/// </summary>
public int TotalBlocks { get; }
/// <summary>
/// Returns the progress percentage as a float from 0 to 1
/// </summary>
public float Percentage => CurrentBlock / (float) TotalBlocks;
public ProgressElement(int currentBlock, int totalBlocks)
{
CurrentBlock = currentBlock;
TotalBlocks = totalBlocks;
}
public override string ToString()
{
return $"{nameof(CurrentBlock)}: {CurrentBlock}, {nameof(TotalBlocks)}: {TotalBlocks}, {nameof(Percentage)}: {Percentage}";
}
}
}