diff options
author | Joffrey Bion <joffrey.bion@booking.com> | 2020-05-26 09:22:59 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@booking.com> | 2020-05-26 09:23:07 +0200 |
commit | 13479d363afd701ed9b66cfc8bb9b72dc725633e (patch) | |
tree | deb3290c98597d897aae4c6e1ffc1c0201500c5d | |
parent | Add heart beats to SW client to avoid disconnections on Heroku (diff) | |
download | seven-wonders-13479d363afd701ed9b66cfc8bb9b72dc725633e.tar.gz seven-wonders-13479d363afd701ed9b66cfc8bb9b72dc725633e.tar.bz2 seven-wonders-13479d363afd701ed9b66cfc8bb9b72dc725633e.zip |
Simplify board summary's code
-rw-r--r-- | sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/BoardSummary.kt | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/BoardSummary.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/BoardSummary.kt index f6225765..37b7c211 100644 --- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/BoardSummary.kt +++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/components/game/BoardSummary.kt @@ -13,12 +13,11 @@ import styled.styledHr enum class BoardSummarySide( val tokenCountPosition: TokenCountPosition, - val scienceCountPosition: TokenCountPosition, val alignment: Align ) { - LEFT(TokenCountPosition.RIGHT, TokenCountPosition.RIGHT, Align.flexStart), - TOP(TokenCountPosition.OVER, TokenCountPosition.OVER, Align.flexStart), - RIGHT(TokenCountPosition.LEFT, TokenCountPosition.LEFT, Align.flexEnd) + LEFT(TokenCountPosition.RIGHT, Align.flexStart), + TOP(TokenCountPosition.OVER, Align.flexStart), + RIGHT(TokenCountPosition.LEFT, Align.flexEnd) } fun RBuilder.boardSummary( @@ -36,7 +35,6 @@ fun RBuilder.boardSummary( backgroundColor = Color.paleGoldenrod.withAlpha(0.5) } val tokenSize = 2.rem - val countPosition = boardSummarySide.tokenCountPosition playerInfo(player, iconSize = 25) styledHr { @@ -58,9 +56,9 @@ fun RBuilder.boardSummary( alignItems = boardSummarySide.alignment if (boardSummarySide == BoardSummarySide.TOP) marginRight = 1.rem else marginBottom = 1.rem } - generalCounts(board, tokenSize, countPosition) + generalCounts(board, tokenSize, boardSummarySide.tokenCountPosition) } - scienceTokens(board, tokenSize, boardSummarySide.scienceCountPosition) + scienceTokens(board, tokenSize, boardSummarySide.tokenCountPosition) } block() } |