|
@@ -273,8 +273,6 @@ namespace MafiaTelegramBot.Game.GameRooms
|
|
|
await Task.Run( async () =>
|
|
|
{
|
|
|
var contendersCopy = contenders.ToList();
|
|
|
- VoteUpList.Clear();
|
|
|
- VoteKillList.Clear();
|
|
|
foreach (var contender in contendersCopy.Where(p => !p.IsBlocked))
|
|
|
if (Players.ContainsKey(contender.Id)) await contender.CurrentRole.DefenceAction();
|
|
|
var votersPlayers = Players.Values.Where(p => p.IsAlive && !p.IsBlocked).ToArray();
|
|
@@ -309,8 +307,6 @@ namespace MafiaTelegramBot.Game.GameRooms
|
|
|
{
|
|
|
await DefencePhase(VoteUpList);
|
|
|
VoteUpList = await CalculateCandidates();
|
|
|
- VoteUpList.Clear();
|
|
|
- VoteKillList.Clear();
|
|
|
switch (VoteUpList.Count)
|
|
|
{
|
|
|
case 0:
|
|
@@ -322,8 +318,6 @@ namespace MafiaTelegramBot.Game.GameRooms
|
|
|
case > 1:
|
|
|
await DefencePhase(VoteUpList);
|
|
|
VoteUpList = await CalculateCandidates();
|
|
|
- VoteUpList.Clear();
|
|
|
- VoteKillList.Clear();
|
|
|
switch (VoteUpList.Count)
|
|
|
{
|
|
|
case 0:
|
|
@@ -368,6 +362,8 @@ namespace MafiaTelegramBot.Game.GameRooms
|
|
|
var max = votes.Max(item => item.count);
|
|
|
var maxObjects = votes.Where(item => item.count == max);
|
|
|
result.AddRange(from obj in maxObjects select Players[obj.id]);
|
|
|
+ VoteKillList.Clear();
|
|
|
+ VoteUpList.Clear();
|
|
|
return result;
|
|
|
}
|
|
|
|