Add project files.

This commit is contained in:
Razmoth
2022-09-27 17:40:31 +04:00
parent 871d908948
commit a476ace7d7
305 changed files with 71340 additions and 84 deletions

30
AssetStudio/Progress.cs Normal file
View File

@@ -0,0 +1,30 @@
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);
}
}
}
}