Unstable v0.1100.0.4 (November 11th 2020)

This commit is contained in:
Joonas Rikkonen
2020-11-06 20:12:15 +02:00
parent 6b36bf809d
commit b772654326
297 changed files with 12502 additions and 4277 deletions
@@ -0,0 +1,54 @@
#nullable enable
using System;
using System.Collections.Generic;
namespace Barotrauma
{
internal enum ReadyStatus
{
Unanswered,
Yes,
No,
}
internal partial class ReadyCheck
{
private readonly float endTime;
private float time;
public readonly Dictionary<byte, ReadyStatus> Clients;
public bool IsFinished = false;
public ReadyCheck(List<byte> clients, float duration = 30)
{
Clients = new Dictionary<byte, ReadyStatus>();
foreach (byte client in clients)
{
if (Clients.ContainsKey(client)) { continue; }
Clients.Add(client, ReadyStatus.Unanswered);
}
time = duration;
endTime = duration;
#if CLIENT
lastSecond = (int) Math.Ceiling(duration);
#endif
}
partial void EndReadyCheck();
public void Update(float deltaTime)
{
if (time > 0)
{
#if CLIENT
UpdateBar();
#endif
time -= deltaTime;
return;
}
EndReadyCheck();
}
}
}