MainActivity.kt
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val issue = Issue()
val result = issue.LOSE
when(result){
issue.WIN->{
findViewById<TextView>(R.id.textView).text = "勝ち"
}
issue.DRAW->{
findViewById<TextView>(R.id.textView).text = "引き分け"
}
issue.LOSE->{
findViewById<TextView>(R.id.textView).text = "負け"
}
}
}
}
data class Issue(
val WIN:Int = 0,
val LOSE:Int = 1,
val DRAW:Int = 2
)