diff options
author | Joffrey Bion <joffrey.bion@booking.com> | 2020-03-27 15:46:29 +0100 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@booking.com> | 2020-03-27 15:46:29 +0100 |
commit | 2bbb2d65d29c6a45344a125fd2fcbf067370ba27 (patch) | |
tree | 1ad2685ef9f8caf41778f611ab06b617b206f46f /sw-ui-kt/src/main | |
parent | Fix server URL in tests (diff) | |
download | seven-wonders-2bbb2d65d29c6a45344a125fd2fcbf067370ba27.tar.gz seven-wonders-2bbb2d65d29c6a45344a125fd2fcbf067370ba27.tar.bz2 seven-wonders-2bbb2d65d29c6a45344a125fd2fcbf067370ba27.zip |
Rename isUser to isMe for clarity
Diffstat (limited to 'sw-ui-kt/src/main')
-rw-r--r-- | sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/RadialPlayerList.kt | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/RadialPlayerList.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/RadialPlayerList.kt index 7c6d688f..364a0dde 100644 --- a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/RadialPlayerList.kt +++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/RadialPlayerList.kt @@ -49,12 +49,12 @@ private fun RBuilder.roundTableImg(): ReactElement = img { } private fun List<PlayerDTO?>.withUserFirst(): List<PlayerDTO?> { - val nonUsersBeginning = takeWhile { !it.isUser } + val nonUsersBeginning = takeWhile { !it.isMe } val userToEnd = subList(nonUsersBeginning.size, size) return userToEnd + nonUsersBeginning } -private val PlayerDTO?.isUser: Boolean get() = this?.isUser ?: false +private val PlayerDTO?.isMe: Boolean get() = this?.isMe ?: false private fun <T> List<T>.growTo(targetSize: Int): List<T?> { if (size >= targetSize) return this @@ -76,7 +76,7 @@ private fun RBuilder.playerItem(player: PlayerDTO): ReactElement = styledDiv { alignItems = Align.center } val title = if (player.isGameOwner) "Game owner" else null - userIcon(isUser = player.isUser, isOwner = player.isGameOwner, title = title) + userIcon(isMe = player.isMe, isOwner = player.isGameOwner, title = title) styledH5 { css { margin = "0" @@ -92,7 +92,7 @@ private fun RBuilder.playerPlaceholder(): ReactElement = styledDiv { alignItems = Align.center opacity = 0.3 } - userIcon(isUser = false, isOwner = false, title = "Waiting for player...") + userIcon(isMe = false, isOwner = false, title = "Waiting for player...") styledH5 { css { margin = "0" @@ -101,8 +101,8 @@ private fun RBuilder.playerPlaceholder(): ReactElement = styledDiv { } } -private fun RBuilder.userIcon(isUser: Boolean, isOwner: Boolean, title: String?): ReactElement { +private fun RBuilder.userIcon(isMe: Boolean, isOwner: Boolean, title: String?): ReactElement { val iconName: IconName = if (isOwner) "badge" else "user" - val intent: Intent = if (isUser) Intent.WARNING else Intent.NONE + val intent: Intent = if (isMe) Intent.WARNING else Intent.NONE return bpIcon(name = iconName, intent = intent, size = 50, title = title) } |