Search in sources :

Example 1 with TeamType

use of no.stelar7.api.l4j8.basic.constants.types.TeamType in project L4J8 by stelar7.

the class MatchHistoryCrawler method insertTeamData.

private void insertTeamData(long matchid, Match match) throws SQLException {
    for (TeamType type : TeamType.values()) {
        TeamStats team = match.getTeamStats(type).get(0);
        tsInsertStatement.setLong(1, matchid);
        tsInsertStatement.setLong(2, team.getTeamType().getValue());
        tsInsertStatement.setBoolean(3, team.isFirstBlood());
        tsInsertStatement.setBoolean(4, team.isFirstTower());
        tsInsertStatement.setBoolean(5, team.isFirstInhibitor());
        tsInsertStatement.setBoolean(6, team.isFirstBaron());
        tsInsertStatement.setBoolean(7, team.isFirstDragon());
        tsInsertStatement.setBoolean(8, team.isFirstRiftHerald());
        tsInsertStatement.setLong(9, team.getTowerKills());
        tsInsertStatement.setLong(10, team.getInhibitorKills());
        tsInsertStatement.setLong(11, team.getBaronKills());
        tsInsertStatement.setLong(12, team.getDragonKills());
        tsInsertStatement.setLong(13, team.getRiftHeraldKills());
        tsInsertStatement.executeUpdate();
        for (BannedChampion ban : team.getBans()) {
            tbInsertStatement.setLong(1, matchid);
            tbInsertStatement.setLong(2, team.getTeamType().getValue());
            tbInsertStatement.setLong(3, ban.getChampionId());
            tbInsertStatement.setLong(4, ban.getPickTurn());
            tbInsertStatement.executeUpdate();
        }
    }
}
Also used : TeamType(no.stelar7.api.l4j8.basic.constants.types.TeamType) BannedChampion(no.stelar7.api.l4j8.pojo.shared.BannedChampion)

Aggregations

TeamType (no.stelar7.api.l4j8.basic.constants.types.TeamType)1 BannedChampion (no.stelar7.api.l4j8.pojo.shared.BannedChampion)1