Preview improvements. StillBug
This commit is contained in:
1 parent
f927552adc
commit
3678d039e3
161 files changed
+34009
-61541
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Code.Game.OfficeGame.Entities;
|
||||
using Code.OfficeGame.BattleMode.Actions;
|
||||
|
||||
namespace Code.OfficeGame.BattleMode.Timeline
|
||||
@@ -101,5 +102,27 @@ namespace Code.OfficeGame.BattleMode.Timeline
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Первый кадр после fromFrame, на котором завершил действие хотя бы один игрок (EntityTeam.Good).
|
||||
/// Если игроков в маске нет (например, игрок мёртв), возвращает LastFrame.
|
||||
/// </summary>
|
||||
public int FindNextPlayerPauseFrame(int fromFrame, EntityProperties[] entities)
|
||||
{
|
||||
ulong playerMask = 0UL;
|
||||
for (int i = 0; i < entities.Length; i++)
|
||||
{
|
||||
if (entities[i].TeamData.Team == EntityTeam.Good)
|
||||
playerMask |= 1UL << i;
|
||||
}
|
||||
|
||||
for (int f = fromFrame + 1; f < _frames.Count; f++)
|
||||
{
|
||||
if ((_frames[f].ReadySlotsMask & playerMask) != 0UL)
|
||||
return f;
|
||||
}
|
||||
|
||||
return LastFrame;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user