Пример #1
0
  public Game makeGameFromInput(String gameTitle, String gameRanking, String gameRules) {
    Game currentGame = new Game();
    currentGame.setGameTitle(gameTitle);

    if (checkNumberFormat(gameRanking)) {
      currentGame.setFunRanking(Integer.parseInt(gameRanking));
    } else {
      return null;
    }

    String[] temp = gameRules.split("\n");
    ArrayList<String> tempRules = new ArrayList<String>();

    for (String tempWord : temp) {
      tempRules.add(tempWord);
    }
    currentGame.setGameRules(tempRules);

    return currentGame;
  }