package com.faforever.client.remote.domain;

import lombok.Getter;
import lombok.Setter;

import java.util.List;
import java.util.Map;

@Getter
@Setter
public class GameInfoMessage extends FafServerMessage {

  private String host;
  private Boolean passwordProtected;
  // TODO use enum
  private String visibility;
  private GameStatus state;
  private Integer numPlayers;
  private Map<String, List<String>> teams;
  private Map<String, Integer> featuredModVersions;
  private String featuredMod;
  private Integer uid;
  private Integer maxPlayers;
  private String title;
  // FAF calls this "game_type" but it's actually the victory condition.
  private VictoryCondition gameType;
  private Map<String, String> simMods;
  private String mapname;
  private Double launchedAt;
  /**
   * The server may either send a single game or a list of games in the same message... *cringe*.
   */
  private List<GameInfoMessage> games;

  public GameInfoMessage() {
    super(FafServerMessageType.GAME_INFO);
  }

  public List<GameInfoMessage> getGames() {
    return games;
  }

  public void setGames(List<GameInfoMessage> games) {
    this.games = games;
  }

  @Override
  public String toString() {
    return "GameInfo{" +
        "uid=" + uid +
        ", title='" + title + '\'' +
        ", state=" + state +
        '}';
  }
}

@@ -81,16 +81,40 @@
 .Setter;
+%0Aimport lombok.ToString;
 %0A%0Aimport
@@ -169,16 +169,58 @@
 @Setter%0A
+@ToString(of = %7B%22uid%22, %22title%22, %22state%22%7D)%0A
 public c
@@ -1069,330 +1069,7 @@
 %0A  %7D
-%0A%0A  public List%3CGameInfoMessage%3E getGames() %7B%0A    return games;%0A  %7D%0A%0A  public void setGames(List%3CGameInfoMessage%3E games) %7B%0A    this.games = games;%0A  %7D%0A%0A  @Override%0A  public String toString() %7B%0A    return %22GameInfo%7B%22 +%0A        %22uid=%22 + uid +%0A        %22, title='%22 + title + '%5C'' +%0A        %22, state=%22 + state +%0A        '%7D';%0A  %7D
 %0A%7D%0A

Clean up GameInfoMessage