package objects;

import data.GuiMysql;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

public class BetDTO {
	int betSeries;
	String match;
	String betType;
	float bet;
	float odds;
	String result;
	String homeTeam;
	String awayTeam;
	int gameId;
	String gameDate;
	float winAmount;
	int countryId;
	int leagueId;
	private String leagueName;
	private final StringProperty option = new SimpleStringProperty();

	public BetDTO(int betSeries, String match, String betType, float bet, float odds, String result) {
		super();
		this.betSeries = betSeries;
		this.match = match;
		this.betType = betType;
		this.bet = bet;
		this.odds = odds;
		this.result = result;
	}

	public BetDTO() {
	}

	public String getMatch() {
		return match;
	}

	public void setMatch(String match) {
		this.match = match;
	}

	public String getBetType() {
		return betType;
	}

	public void setBetType(String betType) {
		this.betType = betType;
	}

	public float getBet() {
		return bet;
	}

	public void setBet(float bet) {
		this.bet = bet;
	}

	public float getOdds() {
		return odds;
	}

	public void setOdds(float odds) {
		this.odds = odds;
	}

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public String getHomeTeam() {
		return homeTeam;
	}

	public void setHomeTeam(String homeTeam) {
		this.homeTeam = homeTeam;
	}

	public String getAwayTeam() {
		return awayTeam;
	}

	public void setAwayTeam(String awayTeam) {
		this.awayTeam = awayTeam;
	}

	public int getGameId() {
		return gameId;
	}

	public void setGameId(int gameId) {
		this.gameId = gameId;
	}

	public void setMatch(String homeTeamName, String awayTeamName) {
		this.match = homeTeamName + " - " + awayTeamName;
	}

	public void setResult(int homeScore, int awayScore) {
		this.result = homeScore + " - " + awayScore;
	}

	public String getGameDate() {
		return gameDate;
	}

	public void setGameDate(String gameDate) {
		this.gameDate = gameDate;
	}

	public float getWinAmount() {
		return winAmount;
	}

	public void setWinAmount(float winAmount) {
		this.winAmount = winAmount;
	}

	public int getCountryId() {
		return countryId;
	}

	public void setCountryId(int countryId) {
		this.countryId = countryId;
	}

	public int getLeagueId() {
		return leagueId;
	}

	public void setLeagueId(int leagueId) {
		this.leagueId = leagueId;
	}

	@Override public String toString() {
		return "Series " + betSeries + " match: " + match + " betType: " + betType + " bet: " + bet + " odds: " + odds + " result: " + result
				+ " homeTeam: " + homeTeam + " awayTeam: " + awayTeam + "gameId: " + gameId + " gameDate: " + gameDate;
	}

	public void setLeague(String league) {
		leagueId = GuiMysql.getInstance().getLeagueInfo(league).getLeagueId();
	}

	public String getLeagueName() {
		return leagueName;
	}

	public int getBetSeries() {
		return Integer.valueOf(option.get());
	}

	public void setBetSeries(String value) {
		option.set(value);
	}

	public void setBetSeries(int value) {
		option.set(String.valueOf(value));
	}

	public StringProperty optionProperty() {
		return option;
	}
}
