public class Query {
	DatabaseConnector db;

	Query() {
		db = new DatabaseConnector("", 0, "wordle.db", "", "");
	}

	public void pullStats(User user) {
		String[][] r;
		db.executeStatement("SELECT * FROM user WHERE user LIKE" + user.getUsername());
		r = db.getCurrentQueryResult().getData();
		user.setCurrentStreak(Integer.parseInt(r[1][0]));
		user.setMaxStreak(Integer.parseInt(r[2][0]));
		user.setWins(Integer.parseInt(r[3][0]));
		user.setTimesPlayed(Integer.parseInt(r[4][0]));

		int wonInTurn[] = new int[6];
		wonInTurn[0] = Integer.parseInt(r[5][0]);
		wonInTurn[1] = Integer.parseInt(r[6][0]);
		wonInTurn[2] = Integer.parseInt(r[7][0]);
		wonInTurn[3] = Integer.parseInt(r[8][0]);
		wonInTurn[4] = Integer.parseInt(r[9][0]);
		wonInTurn[5] = Integer.parseInt(r[10][0]);
		user.setWonInTurn(wonInTurn);

		user.setLastDayWOTDFinished(Integer.parseInt(r[11][0]));

	}

	public void pushStats(User user) {

		db.executeStatement("UPDATE INTO Stats (current_streak," + " max_streak, " + "wins, " + "times_played, "
				+ "won_on_1, " + "won_on_2, " + "won_on_3, " + "won_on_4, " + "won_on_5, " + "won_on_6, "
				+ "last_day_WOTD_finished) " + "VALUES ("
				+ Integer.toString(user.getCurrentStreak())
				+ Integer.toString(user.getMaxStreak())
				+ Integer.toString(user.getWins())
				+ Integer.toString(user.getTimesPlayed())
				+ Integer.toString(user.getWonInTurnIndex(0))
				+ Integer.toString(user.getWonInTurnIndex(1))
				+ Integer.toString(user.getWonInTurnIndex(2))
				+ Integer.toString(user.getWonInTurnIndex(3))
				+ Integer.toString(user.getWonInTurnIndex(4))
				+ Integer.toString(user.getWonInTurnIndex(5))
				+ Integer.toString(user.getLastDayWOTDFinished())
				+ ")");
	}

	public boolean checkLogin(String username, String password) {
		return false;
	}

	public String getWord() {
		return "";
	}
}
