Advertisement
Artyom_Kopan

view/CheckWIn.kt

May 30th, 2022
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 0.64 KB | None | 0 0
  1. package view
  2.  
  3. import ViewModel
  4. import androidx.compose.material.Text
  5. import androidx.compose.runtime.Composable
  6. import androidx.compose.ui.graphics.Color
  7.  
  8. @Suppress("FunctionNaming")
  9. @Composable
  10. fun CheckWin(state: ViewModel.State) {
  11.     if (state.winStatus != WinStatus.CONTINUES) {
  12.         state.screen = Screen.END_GAME
  13.         when (state.winStatus) {
  14.             WinStatus.CROSSES -> Text("Крестики выиграли!", color = Color.Black)
  15.             WinStatus.NOUGHTS -> Text("Нолики выиграли!", color = Color.Black)
  16.             WinStatus.BALANCE -> Text("Ничья!", color = Color.Black)
  17.         }
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement