|
|
|
@@ -1,4 +1,5 @@ |
|
|
|
using System.Threading; |
|
|
|
using System; |
|
|
|
using System.Threading; |
|
|
|
using Preparation.Interface; |
|
|
|
|
|
|
|
namespace GameClass.GameObj |
|
|
|
@@ -8,8 +9,12 @@ namespace GameClass.GameObj |
|
|
|
// xfgg说:爱因斯坦说,每个坐标系都有与之绑定的时钟,(x, y, z, ict) 构成四维时空坐标,在洛伦兹变换下满足矢量性(狗头) |
|
|
|
private readonly GameTimer timer = new(); |
|
|
|
public ITimer Timer => timer; |
|
|
|
|
|
|
|
public class GameTimer : ITimer |
|
|
|
{ |
|
|
|
private int startTime; |
|
|
|
public int nowTime() => Environment.TickCount - startTime; |
|
|
|
|
|
|
|
private bool isGaming = false; |
|
|
|
public bool IsGaming |
|
|
|
{ |
|
|
|
@@ -30,6 +35,7 @@ namespace GameClass.GameObj |
|
|
|
if (isGaming) |
|
|
|
return false; |
|
|
|
isGaming = true; |
|
|
|
startTime = Environment.TickCount; |
|
|
|
} |
|
|
|
Thread.Sleep(timeInMilliseconds); |
|
|
|
isGaming = false; |
|
|
|
|