public void PlayTurn(IBoardState boardState) { Color lastAttackedBy = boardState.AttackHistory.LastOrDefault(x => x.defender.playerColor == this._player.Color).attacker.playerColor; LOGIC_START: foreach (Hex own in boardState.GetFieldsForPlayer(this._player)) { if (own.Dices == 1) { continue; } foreach ((Hex other, RelativeDirection direction) in boardState.GetNeighborsOfColor(lastAttackedBy, own)) { if (own.Dices >= other.Dices && boardState.CanAttack(own, other, out _)) { bool won = boardState.PerformAttack(own, other).victory; if (won) { // Restart the logic to also process the freshly conquered fields goto LOGIC_START; } else { break; } } } } }