const flipLogic: Function = (): void => {
switch (this.getFlipChoice(ballot, raceInd)) {
case FlipChoiceType.INT_WINNER:
if (!intWinnerRatio_tooLow)
if (intLoserRatio_tooLow) flipBallotTo_intendedLoser();
break;
case FlipChoiceType.INT_LOSER:
if (intWinnerRatio_tooLow) flipBallotTo_intendedWinner();
else if (intLoserRatio_tooHigh) flipBallotTo_remainder();
break;
case FlipChoiceType.THIRD_PARTY:
if (intWinnerRatio_tooLow && intLoserRatio_tooHigh)
flipBallotTo_intendedWinner();
break;
case FlipChoiceType.NONE: //adjudicated ballots or undervotes
if (intWinnerRatio_tooLow) flipBallotTo_intendedWinner();
else if (intLoserRatio_tooLow) flipBallotTo_intendedLoser();
else flipBallotTo_remainder();
break;
}
};
Nice. The formatting came out better than I thought it would.
What I started with looked worse, so I switched to simple basic.