mirror of
https://github.com/Gongxh0901/kunpolibrary
synced 2025-11-05 05:45:48 +00:00
修改几个导致声明文件报错的声明;发布1.0.25
This commit is contained in:
@@ -44,27 +44,4 @@ export class MathTool {
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* 内部使用的辅助方法,用于计算平滑过渡的因子
|
||||
* @internal
|
||||
*/
|
||||
public static calculateSmoothFactor(elapsedTime: number, responseTime: number): number {
|
||||
return elapsedTime / (elapsedTime + responseTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 内部使用的工具方法,不应该在库外部使用
|
||||
* @internal
|
||||
*/
|
||||
public static internalRoundToDecimal(value: number, decimals: number): number {
|
||||
const factor = Math.pow(10, decimals);
|
||||
return Math.round(value * factor) / factor;
|
||||
}
|
||||
|
||||
/**
|
||||
* 内部使用的辅助常量
|
||||
* @internal
|
||||
*/
|
||||
public static readonly INTERNAL_EPSILON = 0.00001;
|
||||
}
|
||||
@@ -45,11 +45,11 @@ export class Time {
|
||||
public static get netTimeDiff(): number { return this._netTimeDiff; }
|
||||
|
||||
/** 获取系统运行时间 */
|
||||
public static get runTime(): number { return game.totalTime };
|
||||
public static get runTime(): number { return Math.floor(game.totalTime); }
|
||||
|
||||
|
||||
public static _configBoot(): void {
|
||||
this._osBootTime = Date.now();
|
||||
this._osBootTime = Math.floor(Date.now());
|
||||
log("系统启动时间", this._osBootTime);
|
||||
TimeCache = new Date();
|
||||
this._nowTimestamp = (): number => {
|
||||
@@ -67,7 +67,7 @@ export class Time {
|
||||
}
|
||||
this._netTime = netTime;
|
||||
const localTime = this._nowTimestamp();
|
||||
this._netTimeDiff = this.netTime - localTime;
|
||||
this._netTimeDiff = Math.floor(this.netTime - localTime);
|
||||
log(`设置网络时间: net(${this.formatTime(this.netTime)}), boot(${this.formatTime(this.osBootTime)}), diff(${Math.abs(this.netTimeDiff / 1000)}秒)`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user