== 0 -> { setEmptyGame() } players in 1..3 -> { if (game != null) { this.gameSize = Game.SMALL game.players.forEach { configurePlayer(it, game, Game.SMALL) } } } players in 4..10 -> { if (game != null) { this.gameSize = Game.MEDIUM game.players.forEach { configurePlayer(it, game, Game.MEDIUM) } } } else -> { if (game != null) { this.gameSize = Game.BIG game.players.forEach { configurePlayer(it, game, Game.BIG) } } } } } fun configureGame(players: Int, game: Game?) { when { players == 0 -> setEmptyGame() players in 1..3 -> configureSmallGame(game) players in 4..10 -> configureMediumGame(game) else -> configureBigGame(game) } } refatorando...