added stats model

This commit is contained in:
Wyatt J. Miller 2020-09-17 18:12:34 -04:00
parent 198a1857a4
commit 06036cf5f5

View 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++
}
}