Skip to content

Commit

Permalink
Overriding map name for deadeye canyon.
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamMc331 committed Jul 13, 2023
1 parent 6a45720 commit 6eb15ec
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,18 @@ data class OctaneGGGame(
* Converts an [OctaneGGGame] to a [Game] in our domain.
*/
fun OctaneGGGame.toGame(): Game {
// Currently the octane.gg api does not include a map name for
// this map ID, so let's override it ourselves.
val mapName = when (this.map?.id) {
"outlaw_oasis_p" -> "Deadeye Canyon (Oasis)"
else -> this.map?.name.orEmpty()
}

return Game(
id = this.id.orEmpty(),
blue = this.blue?.toGameTeamResult() ?: GameTeamResult(),
orange = this.orange?.toGameTeamResult() ?: GameTeamResult(),
map = this.map?.name.orEmpty(),
map = mapName,
number = this.number ?: 0,
duration = this.duration ?: Game.GAME_DEFAULT_DURATION_SECONDS,
)
Expand Down

0 comments on commit 6eb15ec

Please sign in to comment.