added stats model
This commit is contained in:
parent
198a1857a4
commit
06036cf5f5
23
app/src/main/java/com/wyattjmiller/tictactoeapp/Stats.kt
Normal file
23
app/src/main/java/com/wyattjmiller/tictactoeapp/Stats.kt
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package com.wyattjmiller.tictactoeapp
|
||||||
|
|
||||||
|
class Stats {
|
||||||
|
private var mGamesPlayed: Int = 0
|
||||||
|
private var mGamesWonX: Int = 0
|
||||||
|
private var mGamesWonO: Int = 0
|
||||||
|
private var mGamePiecesPlaced: Int = 0
|
||||||
|
|
||||||
|
fun updateGamesPlayed() {
|
||||||
|
mGamesPlayed++
|
||||||
|
}
|
||||||
|
|
||||||
|
fun updateGamesWon(gameState: Gameboard.GameState) {
|
||||||
|
when (gameState) {
|
||||||
|
Gameboard.GameState.GamePlayerWinX -> mGamesWonX++
|
||||||
|
Gameboard.GameState.GamePlayerWinO -> mGamesWonO++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun updatePiecePlaced() {
|
||||||
|
mGamePiecesPlaced++
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user