summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/Api.kt2
-rw-r--r--sw-server/src/test/kotlin/org/luxons/sevenwonders/server/controllers/HomeControllerTest.kt2
-rw-r--r--sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/lobby/RadialPlayerList.kt12
3 files changed, 8 insertions, 8 deletions
diff --git a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/Api.kt b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/Api.kt
index 5816edaf..aca9b140 100644
--- a/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/Api.kt
+++ b/sw-common-model/src/commonMain/kotlin/org/luxons/sevenwonders/model/api/Api.kt
@@ -31,5 +31,5 @@ data class PlayerDTO(
val displayName: String,
val index: Int,
val isGameOwner: Boolean,
- val isUser: Boolean
+ val isMe: Boolean
)
diff --git a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/controllers/HomeControllerTest.kt b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/controllers/HomeControllerTest.kt
index c2c3c05d..7d129997 100644
--- a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/controllers/HomeControllerTest.kt
+++ b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/controllers/HomeControllerTest.kt
@@ -20,6 +20,6 @@ class HomeControllerTest {
assertEquals("testuser", player.username)
assertEquals("Test User", player.displayName)
assertEquals(false, player.isGameOwner)
- assertEquals(true, player.isUser)
+ assertEquals(true, player.isMe)
}
}
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)
}
bgstack15