Search in sources :

Example 6 with PlayerStandardTip

use of fr.neamar.lolgamedata.tips.PlayerStandardTip in project teamward-client by Neamar.

the class HardcoreGamerTipBuilder method getTips.

@Override
public ArrayList<Tip> getTips(Game game, Context context) {
    ArrayList<Tip> tips = new ArrayList<>();
    for (Team team : game.teams) {
        for (Player player : team.players) {
            if (player.averageTimeBetweenGames < 24 * 3600 / 10) {
                String descriptionTemplate = context.getString(R.string.hardcore_gamer_description);
                String description = String.format(descriptionTemplate, player.summoner.name);
                tips.add(new PlayerStandardTip(game, player, player.champion.imageUrl, context.getString(R.string.hardcore_gamer), description));
            }
        }
    }
    return tips;
}
Also used : Player(fr.neamar.lolgamedata.pojo.Player) PlayerStandardTip(fr.neamar.lolgamedata.tips.PlayerStandardTip) ArrayList(java.util.ArrayList) PlayerStandardTip(fr.neamar.lolgamedata.tips.PlayerStandardTip) Tip(fr.neamar.lolgamedata.tips.Tip) Team(fr.neamar.lolgamedata.pojo.Team)

Example 7 with PlayerStandardTip

use of fr.neamar.lolgamedata.tips.PlayerStandardTip in project teamward-client by Neamar.

the class NoFlashTipBuilder method getTips.

@Override
public ArrayList<Tip> getTips(Game game, Context context) {
    ArrayList<Tip> tips = new ArrayList<>();
    for (Team team : game.teams) {
        for (Player player : team.players) {
            if (!player.spellD.name.equals("Flash") && !player.spellF.name.equals("Flash")) {
                String descriptionTemplate = context.getString(R.string.s_has_no_flash);
                String description = String.format(descriptionTemplate, player.summoner.name, player.spellD.name, player.spellF.name);
                tips.add(new PlayerStandardTip(game, player, player.champion.imageUrl, context.getString(R.string.no_flash), description));
            }
        }
    }
    return tips;
}
Also used : Player(fr.neamar.lolgamedata.pojo.Player) PlayerStandardTip(fr.neamar.lolgamedata.tips.PlayerStandardTip) ArrayList(java.util.ArrayList) PlayerStandardTip(fr.neamar.lolgamedata.tips.PlayerStandardTip) Tip(fr.neamar.lolgamedata.tips.Tip) Team(fr.neamar.lolgamedata.pojo.Team)

Example 8 with PlayerStandardTip

use of fr.neamar.lolgamedata.tips.PlayerStandardTip in project teamward-client by Neamar.

the class NoSmiteTipBuilder method getTips.

@Override
public ArrayList<Tip> getTips(Game game, Context context) {
    ArrayList<Tip> tips = new ArrayList<>();
    // Only apply on Summoner's Rift
    if (GameActivity.getMapName(game.mapId) != R.string.summoners_rift) {
        return tips;
    }
    for (Team team : game.teams) {
        Boolean teamHasSmite = false;
        for (Player player : team.players) {
            if (player.spellD.name.equals("Smite") || player.spellF.name.equals("Smite")) {
                teamHasSmite = true;
                break;
            }
        }
        if (!teamHasSmite) {
            String description = context.getString(R.string.no_smite_desc);
            description = String.format(description, team.getName(context));
            tips.add(new PlayerStandardTip(game, null, SMITE_URL, context.getString(R.string.no_smite), description));
        }
    }
    return tips;
}
Also used : Player(fr.neamar.lolgamedata.pojo.Player) PlayerStandardTip(fr.neamar.lolgamedata.tips.PlayerStandardTip) ArrayList(java.util.ArrayList) PlayerStandardTip(fr.neamar.lolgamedata.tips.PlayerStandardTip) Tip(fr.neamar.lolgamedata.tips.Tip) Team(fr.neamar.lolgamedata.pojo.Team)

Example 9 with PlayerStandardTip

use of fr.neamar.lolgamedata.tips.PlayerStandardTip in project teamward-client by Neamar.

the class NoobTipBuilder method getTips.

@Override
public ArrayList<Tip> getTips(Game game, Context context) {
    ArrayList<Tip> tips = new ArrayList<>();
    for (Team team : game.teams) {
        for (Player player : team.players) {
            if (player.champion.mastery == 0) {
                String descriptionTemplate = context.getString(R.string.is_playing_for_first_time);
                String description = String.format(descriptionTemplate, player.summoner.name, player.champion.name);
                tips.add(new PlayerStandardTip(game, player, player.champion.imageUrl, context.getString(R.string.noobs_noobs_everywhere), description));
            }
        }
    }
    return tips;
}
Also used : Player(fr.neamar.lolgamedata.pojo.Player) PlayerStandardTip(fr.neamar.lolgamedata.tips.PlayerStandardTip) ArrayList(java.util.ArrayList) PlayerStandardTip(fr.neamar.lolgamedata.tips.PlayerStandardTip) Tip(fr.neamar.lolgamedata.tips.Tip) Team(fr.neamar.lolgamedata.pojo.Team)

Example 10 with PlayerStandardTip

use of fr.neamar.lolgamedata.tips.PlayerStandardTip in project teamward-client by Neamar.

the class DoubleSmiteTipBuilder method getTips.

@Override
public ArrayList<Tip> getTips(Game game, Context context) {
    ArrayList<Tip> tips = new ArrayList<>();
    // Only apply on Summoner's Rift
    if (GameActivity.getMapName(game.mapId) != R.string.summoners_rift) {
        return tips;
    }
    for (Team team : game.teams) {
        int smiteCounter = 0;
        for (Player player : team.players) {
            if (player.spellD.name.equals("Smite") || player.spellF.name.equals("Smite")) {
                smiteCounter++;
            }
        }
        if (smiteCounter > 1) {
            String description = context.getString(R.string.double_smite_desc);
            description = String.format(description, team.getName(context));
            tips.add(new PlayerStandardTip(game, null, SMITE_URL, context.getString(R.string.double_smite), description));
        }
    }
    return tips;
}
Also used : Player(fr.neamar.lolgamedata.pojo.Player) PlayerStandardTip(fr.neamar.lolgamedata.tips.PlayerStandardTip) ArrayList(java.util.ArrayList) PlayerStandardTip(fr.neamar.lolgamedata.tips.PlayerStandardTip) Tip(fr.neamar.lolgamedata.tips.Tip) Team(fr.neamar.lolgamedata.pojo.Team)

Aggregations

PlayerStandardTip (fr.neamar.lolgamedata.tips.PlayerStandardTip)11 Player (fr.neamar.lolgamedata.pojo.Player)10 Tip (fr.neamar.lolgamedata.tips.Tip)10 ArrayList (java.util.ArrayList)10 Team (fr.neamar.lolgamedata.pojo.Team)9 Account (fr.neamar.lolgamedata.pojo.Account)1