package objects;

public class Percentages {

    private int scoringDiffHomeWin = 0;
    private int scoringDiffDraw = 0;
    private int scoringDiffAwayWin = 0;
    private int totalGoalsHomeWin = 0;
    private int totalGoalsDraw = 0;
    private int totalGoalsAwayWin = 0;
    private int winLossRatioHomeAndAwayHomeWin = 0;
    private int winLossRatioHomeAndAwayDraw = 0;
    private int winLossRatioHomeAndAwayAwayWin = 0;
    private int winLossRatioHomeWin = 0;
    private int winLossRatioDraw = 0;
    private int winLossRatioAwayWin = 0;

    public int getTotalGoalsHomeWin() {
        return totalGoalsHomeWin;
    }

    public void setTotalGoalsHomeWin(int totalGoalsHomeWin) {
        this.totalGoalsHomeWin = totalGoalsHomeWin;
    }

    public int getTotalGoalsDraw() {
        return totalGoalsDraw;
    }

    public void setTotalGoalsDraw(int totalGoalsDraw) {
        this.totalGoalsDraw = totalGoalsDraw;
    }

    public int getWinLossRatioHomeAndAwayHomeWin() {
        return winLossRatioHomeAndAwayHomeWin;
    }

    public void setWinLossRatioHomeAndAwayHomeWin(int winLossRatioHomeAndAwayHomeWin) {
        this.winLossRatioHomeAndAwayHomeWin = winLossRatioHomeAndAwayHomeWin;
    }

    public int getWinLossRatioHomeAndAwayDraw() {
        return winLossRatioHomeAndAwayDraw;
    }

    public void setWinLossRatioHomeAndAwayDraw(int winLossRatioHomeAndAwayDraw) {
        this.winLossRatioHomeAndAwayDraw = winLossRatioHomeAndAwayDraw;
    }

    public int getWinLossRatioHomeAndAwayAwayWin() {
        return winLossRatioHomeAndAwayAwayWin;
    }

    public void setWinLossRatioHomeAndAwayAwayWin(int winLossRatioHomeAndAwayAwayWin) {
        this.winLossRatioHomeAndAwayAwayWin = winLossRatioHomeAndAwayAwayWin;
    }

    public int getWinLossRatioHomeWin() {
        return winLossRatioHomeWin;
    }

    public void setWinLossRatioHomeWin(int winLossRatioHomeWin) {
        this.winLossRatioHomeWin = winLossRatioHomeWin;
    }

    public int getWinLossRatioDraw() {
        return winLossRatioDraw;
    }

    public void setWinLossRatioDraw(int winLossRatioDraw) {
        this.winLossRatioDraw = winLossRatioDraw;
    }

    public int getWinLossRatioAwayWin() {
        return winLossRatioAwayWin;
    }

    public void setWinLossRatioAwayWin(int winLossRatioAwayWin) {
        this.winLossRatioAwayWin = winLossRatioAwayWin;
    }

    public int getTotalGoalsAwayWin() {
        return totalGoalsAwayWin;
    }

    public void setTotalGoalsAwayWin(int totalGoalsAwayWin) {
        this.totalGoalsAwayWin = totalGoalsAwayWin;
    }

    public int getScoringDiffHomeWin() {
        return scoringDiffHomeWin;
    }

    public void setScoringDiffHomeWin(int homeWin) {
        scoringDiffHomeWin = homeWin;
    }

    public int getScoringDiffDraw() {
        return scoringDiffDraw;
    }

    public void setScoringDiffDraw(int draws) {
        scoringDiffDraw = draws;
    }

    public int getScoringDiffAwayWin() {
        return scoringDiffAwayWin;
    }

    public void setScoringDiffAwayWin(int awayWin) {
        scoringDiffAwayWin = awayWin;
    }

    public String getCalculation() {
        int homeWinValues = scoringDiffHomeWin > 0 ? 1 : 0 + totalGoalsHomeWin > 0 ? 1 : 0 + winLossRatioHomeWin > 0
                ? 1 : 0 + winLossRatioHomeAndAwayHomeWin > 0 ? 1 : 0;
        int drawWinValues = scoringDiffDraw > 0 ? 1 : 0 + totalGoalsDraw > 0 ? 1 : 0 + winLossRatioDraw > 0 ? 1 :
                0 + winLossRatioHomeAndAwayDraw > 0 ? 1 : 0;
        int awayWinValues = scoringDiffAwayWin > 0 ? 1 : 0 + totalGoalsAwayWin > 0 ? 1 : 0 + winLossRatioAwayWin > 0
                ? 1 : 0 + winLossRatioHomeAndAwayAwayWin > 0 ? 1 : 0;

        float homeWin =
                (scoringDiffHomeWin + totalGoalsHomeWin + winLossRatioHomeWin + winLossRatioHomeAndAwayHomeWin) / (float) homeWinValues;
        float draws =
                (scoringDiffDraw + totalGoalsDraw + winLossRatioDraw + winLossRatioHomeAndAwayDraw) / (float) drawWinValues;
        float awayWin =
                (scoringDiffAwayWin + totalGoalsAwayWin + winLossRatioAwayWin + winLossRatioHomeAndAwayAwayWin) / (float) awayWinValues;

        float sum = homeWin + draws + awayWin;


        return "(" + homeWin/sum + "%, " + draws/sum + "%, " + awayWin/sum + "%)";
    }
}
