mirror of
https://github.com/Dongyifengs/AssetStudio-Genshin-MoYi.git
synced 2025-04-21 12:09:19 +08:00
31 lines
669 B
C#
31 lines
669 B
C#
using System;
|
|
namespace AssetStudio
|
|
{
|
|
public static class Progress
|
|
{
|
|
public static IProgress<int> Default = new Progress<int>();
|
|
private static int preValue;
|
|
|
|
public static void Reset()
|
|
{
|
|
preValue = 0;
|
|
Default.Report(0);
|
|
}
|
|
|
|
public static void Report(int current, int total)
|
|
{
|
|
var value = (int)(current * 100f / total);
|
|
Report(value);
|
|
}
|
|
|
|
private static void Report(int value)
|
|
{
|
|
if (value > preValue)
|
|
{
|
|
preValue = value;
|
|
Default.Report(value);
|
|
}
|
|
}
|
|
}
|
|
}
|