This commit is contained in:
CortexCore
2024-03-31 23:31:00 +08:00
parent e179d2eb53
commit b7b89ee71a
641 changed files with 31286 additions and 22134 deletions

View File

@@ -119,6 +119,8 @@ namespace BITKit
}
public double Interval=1;
private double allowUpdateTime=0;
public bool AllowUpdateWithoutReset => BITApp.Time.TimeAsDouble >= allowUpdateTime;
public double Remaining => allowUpdateTime - BITApp.Time.TimeAsDouble;
public bool AllowUpdate
{
get
@@ -128,7 +130,7 @@ namespace BITKit
return true;
}
}
public bool AllowUpdateWithoutReset => BITApp.Time.TimeAsDouble >= allowUpdateTime;
public void Reset(bool immediately = false)
{
allowUpdateTime = BITApp.Time.TimeAsDouble + (immediately ? 0 : Interval);
@@ -144,6 +146,10 @@ namespace BITKit
{
allowUpdateTime = currentTime + Interval + interval;
}
else
{
allowUpdateTime += interval;
}
}
else
{