Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display team composition #264

Merged
merged 1 commit into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,15 @@ To fully automate update your weekly actions on your *MPG* leagues, you can use
The main output is displaying:

* Injured players, to remove of your team
* Your team composition as remind
* Your team line by line, ordered by efficiency score (*Eff.*), with the players quotation/prices (*Q.*):

```
========== Your league name (leagueId) ==========
Out: Aouar Houssem (M - 34.88) - INJURY_ORANGE - Inconnu (depuis 12/11) - Inconnu
Out: Ambroise Oyongo (D - 11.85) - INJURY_ORANGE - Blessure au genou (depuis 04/11) - Inconnu

Optimized team:
Optimized team (Compo: 343):
+---+--------------------+-------+----+
| P | Player name | Eff. | Q. |
+---+--------------------+-------+----+
Expand Down
1 change: 0 additions & 1 deletion sonar-project.properties

This file was deleted.

8 changes: 4 additions & 4 deletions src/main/java/org/blondin/mpg/Games.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void process(League league, ApiClients apiClients, Config config) {
Comparator.comparing(Player::getPosition).thenComparing(Player::getEfficiency).thenComparing(Player::getQuotation).reversed());

// Write optimized team
writeTeamOptimized(players, config.isDebug());
writeTeamOptimized(players, coach.getComposition(), config.isDebug());

// Auto-update team
if (config.isTeampUpdate()) {
Expand Down Expand Up @@ -104,7 +104,7 @@ public void process(League league, ApiClients apiClients, Config config) {
* Teams players is only id and price paid => replace by real player
*
* @param teamPlayers teams
* @param pool players
* @param pool players
*/
static void completePlayersTeam(Map<String, Player> teamPlayers, PoolPlayers pool) {
List<String> players2Remove = new ArrayList<>();
Expand Down Expand Up @@ -266,8 +266,8 @@ static List<Player> removeOutPlayers(List<Player> players, InjuredSuspendedWrapp
return players;
}

private static void writeTeamOptimized(List<Player> players, boolean isDebug) {
LOG.info("\nOptimized team:");
private static void writeTeamOptimized(List<Player> players, int composition, boolean isDebug) {
LOG.info("\nOptimized team (Compo: {}):", composition);
AsciiTable at = getTable(TABLE_POSITION, TABLE_PLAYER_NAME, TABLE_EFFICIENCY, TABLE_QUOTE);
Position lp = Position.G;
for (Player player : players) {
Expand Down
Loading
Loading