package objects;

import data.GuiMysql;

public class TeamSettings {

	int teamId;
	String teamName;
	int lookbackHome;
	int lookbackDraw;
	int lookbackAway;
	int marginHome;
	int marginDraw;
	int marginAway;

	public TeamSettings(int teamId, String teamName, int lookbackHome, int lookbackDraw, int lookbackAway,
			int marginHome, int marginDraw, int marginAway) {
		this.teamId = teamId;
		this.teamName = teamName;
		this.lookbackHome = lookbackHome;
		this.lookbackDraw = lookbackDraw;
		this.lookbackAway = lookbackAway;
		this.marginHome = marginHome;
		this.marginDraw = marginDraw;
		this.marginAway = marginAway;
	}

	public TeamSettings() {
	}

	public int getTeamId() {
		return teamId;
	}
	public String getTeamName() {
		return teamName;
	}
	public int getLookbackHome() {
		return lookbackHome;
	}
	public int getLookbackDraw() {
		return lookbackDraw;
	}
	public int getLookbackAway() {
		return lookbackAway;
	}
	public int getMarginHome() {
		return marginHome;
	}
	public int getMarginDraw() {
		return marginDraw;
	}
	public int getMarginAway() {
		return marginAway;
	}
	public void setTeamId(int teamId) {
		this.teamId = teamId;
	}
	public void setTeamName(String teamName) {
		this.teamName = teamName;
	}

	public void setLookbackHome(int lookbackHome) {
		if (this.lookbackHome != lookbackHome) {
			GuiMysql.getInstance().setTeamLookbackHome(teamId, lookbackHome);
		}
		this.lookbackHome = lookbackHome;
	}
	public void setLookbackDraw(int lookbackDraw) {
		if (this.lookbackDraw != lookbackDraw) {
			GuiMysql.getInstance().setTeamLookbackDraw(teamId, lookbackDraw);
		}
		this.lookbackDraw = lookbackDraw;
	}
	public void setLookbackAway(int lookbackAway) {
		if (this.lookbackAway != lookbackAway) {
			GuiMysql.getInstance().setTeamLookbackAway(teamId, lookbackAway);
		}
		this.lookbackAway = lookbackAway;
	}

	public void setMarginHome(int marginHome) {
		if (marginHome != this.marginHome) {
			GuiMysql.getInstance().setTeamMarginHome(teamId, marginHome);
		}
		this.marginHome = marginHome;
	}
	public void setMarginDraw(int marginDraw) {
		if (this.marginDraw != marginDraw) {
			GuiMysql.getInstance().setTeamMarginDraw(teamId, marginDraw);
		}
		this.marginDraw = marginDraw;
	}
	public void setMarginAway(int marginAway) {
		if (this.marginAway != marginAway) {
			GuiMysql.getInstance().setTeamMarginAway(teamId, marginAway);
		}
		this.marginAway = marginAway;
	}

}
