public void StartUnitTurn(Unit unit)
 {
     _infoBar.SetPlayerTurn(currentRound, playerNames[currentGangTurn]);
     Unit.ActiveUnit = unit;
     ResetTimer();
     MoveGrid.ResetMovedGrid();
     unit.StartTurn();
 }
 public void EndUnitTurn()
 {
     MoveGrid.ResetMovedGrid();
     RefreshActiveUnitNumbers();
     if (activeUnits[currentGangTurn] + activeUnits[NextGangTurn()] == 0)
     {
         NextRound();
     }
     else
     {
         if (activeUnits[NextGangTurn()] > 0)
         {
             currentGangTurn = NextGangTurn();
         }
         if (currentGangTurn == gangNumber)
         {
             StartUnitTurn(FindNextUnit());
         }
     }
 }
        private void SwitchUnit(object sender, EventArgs args)
        {
            if (activeUnits[currentGangTurn] == 1)
            {
                return;
            }
            if (Unit.ActiveUnit.moveTaken)
            {
                return;
            }
            var currentUnits = Unit.All.Where(unit => unit.gang == currentGangTurn && !unit.turnTaken).ToList();
            var unitIndex    = currentUnits.IndexOf(Unit.ActiveUnit);

            unitIndex++;
            if (unitIndex >= currentUnits.Count)
            {
                unitIndex = 0;
            }
            MoveGrid.ResetMovedGrid();
            StartUnitTurn(currentUnits[unitIndex]);
        }