Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@Composable
fun Board(
fromState: GameSnapshotState,
toState: GameSnapshotState,
uiState: UiState,
isFlipped: Boolean = false,
onClick: (Position) -> Unit,
) {
BoxWithConstraints(
modifier = Modifier
.fillMaxWidth()
.aspectRatio(1f)
) {
val boardProperties =
BoardRenderProperties(
fromState = fromState,
toState = toState,
uiState = uiState,
squareSize = maxWidth / 8,
isFlipped = isFlipped,
onClick = onClick
)
DefaultBoardRenderer.decorations.forEach {
it.render(properties = boardProperties)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment