Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
yamin8000 committed May 14, 2023
1 parent bcdf319 commit 4e4d71c
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,21 +261,17 @@ private fun GameBoard(
) {
gameCells.forEachIndexed { _, row ->
itemsIndexed(row) { _, cell ->
val colors = if (cell in winnerCells) listOf(
MaterialTheme.colorScheme.secondary,
MaterialTheme.colorScheme.onSecondary
) else listOf(
MaterialTheme.colorScheme.primary,
MaterialTheme.colorScheme.onPrimary
)
val colors = if (cell in winnerCells)
MaterialTheme.colorScheme.secondary to MaterialTheme.colorScheme.onSecondary
else MaterialTheme.colorScheme.primary to MaterialTheme.colorScheme.onPrimary
DoozItem(
clickable = !isGameFinished && currentPlayerType == PlayerType.Human && cell.owner == null,
shape = shapeProvider(cell.owner),
itemSize = boxItemSize,
doozCellOwner = cell.owner,
onClick = { onItemClick(cell) },
itemBackgroundColor = colors.first(),
itemContentColor = colors.component2()
itemBackgroundColor = colors.first,
itemContentColor = colors.second
)
}
}
Expand Down

0 comments on commit 4e4d71c

Please sign in to comment.