3 using System.Collections.Generic;
7 internal enum ReadyStatus
14 internal partial class ReadyCheck
16 private readonly DateTime endTime;
17 private readonly DateTime startTime;
18 public readonly Dictionary<byte, ReadyStatus> Clients;
19 public bool IsFinished =
false;
21 public ReadyCheck(List<byte> clients, DateTime startTime, DateTime endTime)
24 this.startTime = startTime;
25 this.endTime = endTime;
28 public ReadyCheck(List<byte> clients,
float duration)
31 startTime = DateTime.Now;
32 endTime = startTime +
new TimeSpan(0, 0, 0, 0, (
int)(duration * 1000));
35 private ReadyCheck(List<byte> clients)
37 Clients =
new Dictionary<byte, ReadyStatus>();
38 foreach (
byte client
in clients)
40 if (Clients.ContainsKey(client)) {
continue; }
42 Clients.Add(client, ReadyStatus.Unanswered);
46 partial
void EndReadyCheck();
48 public void Update(
float deltaTime)
50 if (DateTime.Now < endTime)