Skip to content

Commit

Permalink
Display team composition
Browse files Browse the repository at this point in the history
  • Loading branch information
axel3rd committed Sep 8, 2024
1 parent d304a33 commit 7c9e931
Show file tree
Hide file tree
Showing 4 changed files with 236 additions and 128 deletions.
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

0 comments on commit 7c9e931

Please sign in to comment.