6 Commits

Author SHA1 Message Date
crsmthw 8be13ed8db Ignore keystore files 2026-05-15 11:07:16 +03:00
crsmthw f9f3fc42e3 Remove .idea from tracking 2026-05-15 10:35:40 +03:00
crsmthw 5b082591a2 Remove local.properties from tracking 2026-05-15 10:35:17 +03:00
crsmthw 115e4a32ac Remove build artifacts and update .gitignore 2026-05-15 10:33:46 +03:00
crsmthw 6f8c426520 Initial commit 2026-05-15 10:19:38 +03:00
crsmthw 04b11797d0 Initial commit 2026-05-15 10:03:12 +03:00
1107 changed files with 36330 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
# ---> Android
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Log/OS Files
*.log
# Android Studio generated files and folders
captures/
.externalNativeBuild/
.cxx/
*.apk
output.json
# IntelliJ
*.iml
.idea/
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml
# Keystore files
*.jks
*.keystore
# Google Services (e.g. APIs or Firebase)
google-services.json
# Android Profiling
*.hprof
build/
local.properties
.idea/
*.jks
*.keystore
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View File
Binary file not shown.
@@ -0,0 +1,2 @@
#Fri May 15 09:36:35 AST 2026
gradle.version=9.4.1
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
849b586a-06f6-407a-ab31-fb040f1195f²
Binary file not shown.
View File
+18
View File
@@ -0,0 +1,18 @@
MIT License
Copyright (c) 2026 crsmthw
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
+120
View File
@@ -0,0 +1,120 @@
# Phase 10 Score Tracker
An ad-free, open source score tracker for the Phase 10 card game. Built for Android with Jetpack Compose and Material 3 Expressive.
---
## Why This Exists
Every Phase 10 score tracker app on the Play Store falls into one of a few categories: riddled with ads that break on an AdGuard network, so basic they're just a notepad with a counter, or missing obvious features like saving your regular players so you don't have to type the same six names every single game. This one does none of that. It works fully offline, has no ads, no tracking, no analytics, and no nonsense — and it actually remembers who you play with.
---
## Features
### Game Management
- **Saved player roster** — add your regular crew once, pick them from the list every game
- **Flexible game setup** — select any combination of saved players, drag to reorder them before the game starts
- **Dealer rotation** — automatically tracks who the dealer is each round, based on the player order set at game start
- **Resume game** — if the app is killed mid-game (RAM cleared, crash, whatever), your game is saved and waiting when you reopen it
- **End game early** — stop the game at any point; the current leader is declared the winner based on highest phase reached, then lowest score as tiebreaker
- **Tied winner support** — if two players finish on the same phase with the same score, both are declared winners and both get the win recorded
### Scoring
- **Cumulative scoring** — enter card values left in each player's hand at the end of every round; the app adds them up
- **Phase tracking** — each player's current phase is tracked automatically; it advances when they complete a phase
- **Smart phase completion** — if a player's score is 0 (went out) or below 50 (completed phase, few cards left), the "Phase Completed" toggle is checked automatically
- **Manual override** — the phase completion toggle can be manually checked for edge cases (e.g. a player completes their phase but foolishly holds wild cards, pushing their score above 50)
- **Card values reference** — tap the ️ button on the round entry screen for a quick reminder of how much each card type is worth (single digits: 5pts, double digits: 10pts, Skip: 15pts, Wild: 25pts)
- **Correct winner logic** — highest phase reached wins; lowest score breaks ties among players on the same phase
### Screens
**Home** — start a new game, resume an in-progress game, or browse the leaderboard
**Game Setup** — pick players from your saved roster, set the phase ruleset, drag cards into play order using the ≡ handle with haptic feedback
**Active Game (Scores tab)** — live scoreboard sorted by highest phase then lowest score. Rank badges for all players. Tap any card to expand the current phase rule. Dealer badge shown inline
**Active Game (By Phase tab)** — players grouped by their current phase, with the phase rule shown as a header above each group
**Round Entry** — full-width score input per player, keyboard-aware layout so fields are never hidden. Phase completion shown as a tappable row below each score field
**Game Results** — winner announcement with animated trophy, tie support, full final standings sorted by phase then score
**Leaderboard** — lifetime stats for every saved player: games played, wins, win percentage. Sorted by win %
**Custom Rules** — create named rule sets with custom phase descriptions. Select them at game setup instead of the official rules. Official rules shown as a reference card
### Adaptive Layout
- **Foldable support** — on the Samsung Galaxy Z Fold 6 (and any wide-screen device), the Active Game screen shows Scores and By Phase side by side simultaneously
- **Seamless transition** — folding and unfolding the phone transitions between single and dual pane layouts automatically
- **Tablet ready** — same dual-pane layout activates on tablets at ≥600dp width
### Design
- **Material 3 Expressive** — built on the latest Material You design system
- **Dynamic color** — app colors are extracted from your wallpaper automatically on Android 12+
- **Themed icon** — monochrome adaptive icon layer means the app icon adopts your wallpaper palette in themed icon mode
- **Dark mode** — full dark theme support, follows system setting
- **Edge to edge** — content renders behind the status and navigation bars properly
---
## Tech Stack
| Layer | Library |
|---|---|
| UI | Jetpack Compose |
| Design system | Material 3 (`material3:1.5.0-alpha19`) |
| Navigation | Compose Navigation |
| Database | Room |
| Reactive state | Kotlin Flow + StateFlow |
| Architecture | MVVM (ViewModel + Repository) |
| Drag reorder | `sh.calvin.reorderable` |
| Adaptive layout | `androidx.compose.material3.adaptive` |
| Build | AGP 9.2.1, Kotlin 2.3.10, KSP 2.3.8 |
| Min SDK | 35 (Android 15) |
| Target SDK | 37 (Android 16) |
---
## Building
Requirements: Android Studio (latest stable), JDK 17+, Android SDK 37.
```bash
git clone https://gitea.crsmthw.com/cris/phase10tracker.git
cd phase10tracker
# Open in Android Studio and let Gradle sync
# Or build from terminal:
./gradlew assembleDebug
```
The APK will be at `app/build/outputs/apk/debug/app-debug.apk`.
---
## Official Phase 10 Rules (reference)
| Phase | Rule |
|---|---|
| 1 | 2 sets of 3 |
| 2 | 1 set of 3 + 1 run of 4 |
| 3 | 1 set of 4 + 1 run of 4 |
| 4 | 1 run of 7 |
| 5 | 1 run of 8 |
| 6 | 1 run of 9 |
| 7 | 2 sets of 4 |
| 8 | 7 cards of 1 color |
| 9 | 1 set of 5 + 1 set of 2 |
| 10 | 1 set of 5 + 1 set of 3 |
---
## License
MIT. Do whatever you want with it.
---
*Built with Claude — because the Play Store didn't deserve another ad-infested score tracker.*
+109
View File
@@ -0,0 +1,109 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.plugin.compose")
id("com.google.devtools.ksp")
}
android {
namespace = "com.crsmthw.phase10tracker"
compileSdk = 37
defaultConfig {
applicationId = "com.crsmthw.phase10tracker"
minSdk = 35
targetSdk = 37
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}
buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
compose = true
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}
dependencies {
// Compose BOM — pins all stable Compose versions
val composeBom = platform("androidx.compose:compose-bom:2026.04.01")
implementation(composeBom)
androidTestImplementation(composeBom)
// Core Compose
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")
// Material 3 Expressive — alpha for full M3 Expressive API surface
implementation("androidx.compose.material3:material3:1.5.0-alpha19")
implementation("androidx.compose.material:material-icons-core")
implementation("androidx.compose.material:material-icons-extended")
// Adaptive layouts (for foldable / tablet)
implementation("androidx.compose.material3.adaptive:adaptive:1.2.0")
implementation("androidx.compose.material3.adaptive:adaptive-layout:1.2.0")
implementation("androidx.compose.material3.adaptive:adaptive-navigation:1.2.0")
// Activity & Window
implementation("androidx.activity:activity-compose:1.13.0")
implementation("androidx.core:core-ktx:1.18.0")
implementation("androidx.window:window:1.5.1")
// Lifecycle / ViewModel
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.10.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.10.0")
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.10.0")
// Navigation
implementation("androidx.navigation:navigation-compose:2.9.8")
// Room (local DB for persistent state)
implementation("androidx.room:room-runtime:2.8.4")
implementation("androidx.room:room-ktx:2.8.4")
ksp("androidx.room:room-compiler:2.8.4")
// DataStore (for simple prefs)
implementation("androidx.datastore:datastore-preferences:1.2.1")
// Coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.11.0")
// Serialization
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.11.0")
// Drag-to-reorder for LazyColumn
implementation("sh.calvin.reorderable:reorderable:3.1.0")
// Test
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.3.0")
androidTestImplementation("androidx.test.espresso:espresso-core:3.7.0")
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
}
@@ -0,0 +1,96 @@
package com.crsmthw.phase10tracker.`data`.db
import androidx.room.EntityDeleteOrUpdateAdapter
import androidx.room.EntityInsertAdapter
import androidx.room.RoomDatabase
import androidx.room.coroutines.createFlow
import androidx.room.util.getColumnIndexOrThrow
import androidx.room.util.performSuspending
import androidx.sqlite.SQLiteStatement
import com.crsmthw.phase10tracker.`data`.model.CustomRuleSetEntity
import javax.`annotation`.processing.Generated
import kotlin.Int
import kotlin.Long
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.MutableList
import kotlin.collections.mutableListOf
import kotlin.reflect.KClass
import kotlinx.coroutines.flow.Flow
@Generated(value = ["androidx.room.RoomProcessor"])
@Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"])
public class CustomRuleSetDao_Impl(
__db: RoomDatabase,
) : CustomRuleSetDao {
private val __db: RoomDatabase
private val __insertAdapterOfCustomRuleSetEntity: EntityInsertAdapter<CustomRuleSetEntity>
private val __deleteAdapterOfCustomRuleSetEntity: EntityDeleteOrUpdateAdapter<CustomRuleSetEntity>
init {
this.__db = __db
this.__insertAdapterOfCustomRuleSetEntity = object : EntityInsertAdapter<CustomRuleSetEntity>() {
protected override fun createQuery(): String = "INSERT OR REPLACE INTO `custom_rule_sets` (`id`,`name`,`rulesJson`,`createdAt`) VALUES (nullif(?, 0),?,?,?)"
protected override fun bind(statement: SQLiteStatement, entity: CustomRuleSetEntity) {
statement.bindLong(1, entity.id)
statement.bindText(2, entity.name)
statement.bindText(3, entity.rulesJson)
statement.bindLong(4, entity.createdAt)
}
}
this.__deleteAdapterOfCustomRuleSetEntity = object : EntityDeleteOrUpdateAdapter<CustomRuleSetEntity>() {
protected override fun createQuery(): String = "DELETE FROM `custom_rule_sets` WHERE `id` = ?"
protected override fun bind(statement: SQLiteStatement, entity: CustomRuleSetEntity) {
statement.bindLong(1, entity.id)
}
}
}
public override suspend fun insertRuleSet(ruleSet: CustomRuleSetEntity): Long = performSuspending(__db, false, true) { _connection ->
val _result: Long = __insertAdapterOfCustomRuleSetEntity.insertAndReturnId(_connection, ruleSet)
_result
}
public override suspend fun deleteRuleSet(ruleSet: CustomRuleSetEntity): Unit = performSuspending(__db, false, true) { _connection ->
__deleteAdapterOfCustomRuleSetEntity.handle(_connection, ruleSet)
}
public override fun getAllRuleSets(): Flow<List<CustomRuleSetEntity>> {
val _sql: String = "SELECT * FROM custom_rule_sets ORDER BY createdAt DESC"
return createFlow(__db, false, arrayOf("custom_rule_sets")) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
val _columnIndexOfId: Int = getColumnIndexOrThrow(_stmt, "id")
val _columnIndexOfName: Int = getColumnIndexOrThrow(_stmt, "name")
val _columnIndexOfRulesJson: Int = getColumnIndexOrThrow(_stmt, "rulesJson")
val _columnIndexOfCreatedAt: Int = getColumnIndexOrThrow(_stmt, "createdAt")
val _result: MutableList<CustomRuleSetEntity> = mutableListOf()
while (_stmt.step()) {
val _item: CustomRuleSetEntity
val _tmpId: Long
_tmpId = _stmt.getLong(_columnIndexOfId)
val _tmpName: String
_tmpName = _stmt.getText(_columnIndexOfName)
val _tmpRulesJson: String
_tmpRulesJson = _stmt.getText(_columnIndexOfRulesJson)
val _tmpCreatedAt: Long
_tmpCreatedAt = _stmt.getLong(_columnIndexOfCreatedAt)
_item = CustomRuleSetEntity(_tmpId,_tmpName,_tmpRulesJson,_tmpCreatedAt)
_result.add(_item)
}
_result
} finally {
_stmt.close()
}
}
}
public companion object {
public fun getRequiredConverters(): List<KClass<*>> = emptyList()
}
}
@@ -0,0 +1,310 @@
package com.crsmthw.phase10tracker.`data`.db
import androidx.room.EntityDeleteOrUpdateAdapter
import androidx.room.EntityInsertAdapter
import androidx.room.RoomDatabase
import androidx.room.coroutines.createFlow
import androidx.room.util.getColumnIndexOrThrow
import androidx.room.util.performSuspending
import androidx.sqlite.SQLiteStatement
import com.crsmthw.phase10tracker.`data`.model.GameEntity
import javax.`annotation`.processing.Generated
import kotlin.Boolean
import kotlin.Int
import kotlin.Long
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.reflect.KClass
import kotlinx.coroutines.flow.Flow
@Generated(value = ["androidx.room.RoomProcessor"])
@Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"])
public class GameDao_Impl(
__db: RoomDatabase,
) : GameDao {
private val __db: RoomDatabase
private val __insertAdapterOfGameEntity: EntityInsertAdapter<GameEntity>
private val __updateAdapterOfGameEntity: EntityDeleteOrUpdateAdapter<GameEntity>
init {
this.__db = __db
this.__insertAdapterOfGameEntity = object : EntityInsertAdapter<GameEntity>() {
protected override fun createQuery(): String = "INSERT OR REPLACE INTO `games` (`id`,`startedAt`,`finishedAt`,`isComplete`,`winnerId`,`currentRound`,`currentDealerIndex`) VALUES (nullif(?, 0),?,?,?,?,?,?)"
protected override fun bind(statement: SQLiteStatement, entity: GameEntity) {
statement.bindLong(1, entity.id)
statement.bindLong(2, entity.startedAt)
val _tmpFinishedAt: Long? = entity.finishedAt
if (_tmpFinishedAt == null) {
statement.bindNull(3)
} else {
statement.bindLong(3, _tmpFinishedAt)
}
val _tmp: Int = if (entity.isComplete) 1 else 0
statement.bindLong(4, _tmp.toLong())
val _tmpWinnerId: Long? = entity.winnerId
if (_tmpWinnerId == null) {
statement.bindNull(5)
} else {
statement.bindLong(5, _tmpWinnerId)
}
statement.bindLong(6, entity.currentRound.toLong())
statement.bindLong(7, entity.currentDealerIndex.toLong())
}
}
this.__updateAdapterOfGameEntity = object : EntityDeleteOrUpdateAdapter<GameEntity>() {
protected override fun createQuery(): String = "UPDATE OR ABORT `games` SET `id` = ?,`startedAt` = ?,`finishedAt` = ?,`isComplete` = ?,`winnerId` = ?,`currentRound` = ?,`currentDealerIndex` = ? WHERE `id` = ?"
protected override fun bind(statement: SQLiteStatement, entity: GameEntity) {
statement.bindLong(1, entity.id)
statement.bindLong(2, entity.startedAt)
val _tmpFinishedAt: Long? = entity.finishedAt
if (_tmpFinishedAt == null) {
statement.bindNull(3)
} else {
statement.bindLong(3, _tmpFinishedAt)
}
val _tmp: Int = if (entity.isComplete) 1 else 0
statement.bindLong(4, _tmp.toLong())
val _tmpWinnerId: Long? = entity.winnerId
if (_tmpWinnerId == null) {
statement.bindNull(5)
} else {
statement.bindLong(5, _tmpWinnerId)
}
statement.bindLong(6, entity.currentRound.toLong())
statement.bindLong(7, entity.currentDealerIndex.toLong())
statement.bindLong(8, entity.id)
}
}
}
public override suspend fun insertGame(game: GameEntity): Long = performSuspending(__db, false, true) { _connection ->
val _result: Long = __insertAdapterOfGameEntity.insertAndReturnId(_connection, game)
_result
}
public override suspend fun updateGame(game: GameEntity): Unit = performSuspending(__db, false, true) { _connection ->
__updateAdapterOfGameEntity.handle(_connection, game)
}
public override suspend fun getActiveGame(): GameEntity? {
val _sql: String = "SELECT * FROM games WHERE isComplete = 0 ORDER BY startedAt DESC LIMIT 1"
return performSuspending(__db, true, false) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
val _columnIndexOfId: Int = getColumnIndexOrThrow(_stmt, "id")
val _columnIndexOfStartedAt: Int = getColumnIndexOrThrow(_stmt, "startedAt")
val _columnIndexOfFinishedAt: Int = getColumnIndexOrThrow(_stmt, "finishedAt")
val _columnIndexOfIsComplete: Int = getColumnIndexOrThrow(_stmt, "isComplete")
val _columnIndexOfWinnerId: Int = getColumnIndexOrThrow(_stmt, "winnerId")
val _columnIndexOfCurrentRound: Int = getColumnIndexOrThrow(_stmt, "currentRound")
val _columnIndexOfCurrentDealerIndex: Int = getColumnIndexOrThrow(_stmt, "currentDealerIndex")
val _result: GameEntity?
if (_stmt.step()) {
val _tmpId: Long
_tmpId = _stmt.getLong(_columnIndexOfId)
val _tmpStartedAt: Long
_tmpStartedAt = _stmt.getLong(_columnIndexOfStartedAt)
val _tmpFinishedAt: Long?
if (_stmt.isNull(_columnIndexOfFinishedAt)) {
_tmpFinishedAt = null
} else {
_tmpFinishedAt = _stmt.getLong(_columnIndexOfFinishedAt)
}
val _tmpIsComplete: Boolean
val _tmp: Int
_tmp = _stmt.getLong(_columnIndexOfIsComplete).toInt()
_tmpIsComplete = _tmp != 0
val _tmpWinnerId: Long?
if (_stmt.isNull(_columnIndexOfWinnerId)) {
_tmpWinnerId = null
} else {
_tmpWinnerId = _stmt.getLong(_columnIndexOfWinnerId)
}
val _tmpCurrentRound: Int
_tmpCurrentRound = _stmt.getLong(_columnIndexOfCurrentRound).toInt()
val _tmpCurrentDealerIndex: Int
_tmpCurrentDealerIndex = _stmt.getLong(_columnIndexOfCurrentDealerIndex).toInt()
_result = GameEntity(_tmpId,_tmpStartedAt,_tmpFinishedAt,_tmpIsComplete,_tmpWinnerId,_tmpCurrentRound,_tmpCurrentDealerIndex)
} else {
_result = null
}
_result
} finally {
_stmt.close()
}
}
}
public override fun observeActiveGame(): Flow<GameEntity?> {
val _sql: String = "SELECT * FROM games WHERE isComplete = 0 ORDER BY startedAt DESC LIMIT 1"
return createFlow(__db, false, arrayOf("games")) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
val _columnIndexOfId: Int = getColumnIndexOrThrow(_stmt, "id")
val _columnIndexOfStartedAt: Int = getColumnIndexOrThrow(_stmt, "startedAt")
val _columnIndexOfFinishedAt: Int = getColumnIndexOrThrow(_stmt, "finishedAt")
val _columnIndexOfIsComplete: Int = getColumnIndexOrThrow(_stmt, "isComplete")
val _columnIndexOfWinnerId: Int = getColumnIndexOrThrow(_stmt, "winnerId")
val _columnIndexOfCurrentRound: Int = getColumnIndexOrThrow(_stmt, "currentRound")
val _columnIndexOfCurrentDealerIndex: Int = getColumnIndexOrThrow(_stmt, "currentDealerIndex")
val _result: GameEntity?
if (_stmt.step()) {
val _tmpId: Long
_tmpId = _stmt.getLong(_columnIndexOfId)
val _tmpStartedAt: Long
_tmpStartedAt = _stmt.getLong(_columnIndexOfStartedAt)
val _tmpFinishedAt: Long?
if (_stmt.isNull(_columnIndexOfFinishedAt)) {
_tmpFinishedAt = null
} else {
_tmpFinishedAt = _stmt.getLong(_columnIndexOfFinishedAt)
}
val _tmpIsComplete: Boolean
val _tmp: Int
_tmp = _stmt.getLong(_columnIndexOfIsComplete).toInt()
_tmpIsComplete = _tmp != 0
val _tmpWinnerId: Long?
if (_stmt.isNull(_columnIndexOfWinnerId)) {
_tmpWinnerId = null
} else {
_tmpWinnerId = _stmt.getLong(_columnIndexOfWinnerId)
}
val _tmpCurrentRound: Int
_tmpCurrentRound = _stmt.getLong(_columnIndexOfCurrentRound).toInt()
val _tmpCurrentDealerIndex: Int
_tmpCurrentDealerIndex = _stmt.getLong(_columnIndexOfCurrentDealerIndex).toInt()
_result = GameEntity(_tmpId,_tmpStartedAt,_tmpFinishedAt,_tmpIsComplete,_tmpWinnerId,_tmpCurrentRound,_tmpCurrentDealerIndex)
} else {
_result = null
}
_result
} finally {
_stmt.close()
}
}
}
public override fun getGameById(id: Long): Flow<GameEntity?> {
val _sql: String = "SELECT * FROM games WHERE id = ?"
return createFlow(__db, false, arrayOf("games")) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
var _argIndex: Int = 1
_stmt.bindLong(_argIndex, id)
val _columnIndexOfId: Int = getColumnIndexOrThrow(_stmt, "id")
val _columnIndexOfStartedAt: Int = getColumnIndexOrThrow(_stmt, "startedAt")
val _columnIndexOfFinishedAt: Int = getColumnIndexOrThrow(_stmt, "finishedAt")
val _columnIndexOfIsComplete: Int = getColumnIndexOrThrow(_stmt, "isComplete")
val _columnIndexOfWinnerId: Int = getColumnIndexOrThrow(_stmt, "winnerId")
val _columnIndexOfCurrentRound: Int = getColumnIndexOrThrow(_stmt, "currentRound")
val _columnIndexOfCurrentDealerIndex: Int = getColumnIndexOrThrow(_stmt, "currentDealerIndex")
val _result: GameEntity?
if (_stmt.step()) {
val _tmpId: Long
_tmpId = _stmt.getLong(_columnIndexOfId)
val _tmpStartedAt: Long
_tmpStartedAt = _stmt.getLong(_columnIndexOfStartedAt)
val _tmpFinishedAt: Long?
if (_stmt.isNull(_columnIndexOfFinishedAt)) {
_tmpFinishedAt = null
} else {
_tmpFinishedAt = _stmt.getLong(_columnIndexOfFinishedAt)
}
val _tmpIsComplete: Boolean
val _tmp: Int
_tmp = _stmt.getLong(_columnIndexOfIsComplete).toInt()
_tmpIsComplete = _tmp != 0
val _tmpWinnerId: Long?
if (_stmt.isNull(_columnIndexOfWinnerId)) {
_tmpWinnerId = null
} else {
_tmpWinnerId = _stmt.getLong(_columnIndexOfWinnerId)
}
val _tmpCurrentRound: Int
_tmpCurrentRound = _stmt.getLong(_columnIndexOfCurrentRound).toInt()
val _tmpCurrentDealerIndex: Int
_tmpCurrentDealerIndex = _stmt.getLong(_columnIndexOfCurrentDealerIndex).toInt()
_result = GameEntity(_tmpId,_tmpStartedAt,_tmpFinishedAt,_tmpIsComplete,_tmpWinnerId,_tmpCurrentRound,_tmpCurrentDealerIndex)
} else {
_result = null
}
_result
} finally {
_stmt.close()
}
}
}
public override suspend fun cancelAllIncompleteGames(now: Long) {
val _sql: String = "UPDATE games SET isComplete = 1, finishedAt = ? WHERE isComplete = 0"
return performSuspending(__db, false, true) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
var _argIndex: Int = 1
_stmt.bindLong(_argIndex, now)
_stmt.step()
} finally {
_stmt.close()
}
}
}
public override suspend fun advanceRound(
id: Long,
round: Int,
dealerIndex: Int,
) {
val _sql: String = "UPDATE games SET currentRound = ?, currentDealerIndex = ? WHERE id = ?"
return performSuspending(__db, false, true) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
var _argIndex: Int = 1
_stmt.bindLong(_argIndex, round.toLong())
_argIndex = 2
_stmt.bindLong(_argIndex, dealerIndex.toLong())
_argIndex = 3
_stmt.bindLong(_argIndex, id)
_stmt.step()
} finally {
_stmt.close()
}
}
}
public override suspend fun finishGame(
id: Long,
winnerId: Long,
finishedAt: Long,
) {
val _sql: String = """
|
| UPDATE games
| SET isComplete = 1, finishedAt = ?, winnerId = ?
| WHERE id = ?
|
""".trimMargin()
return performSuspending(__db, false, true) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
var _argIndex: Int = 1
_stmt.bindLong(_argIndex, finishedAt)
_argIndex = 2
_stmt.bindLong(_argIndex, winnerId)
_argIndex = 3
_stmt.bindLong(_argIndex, id)
_stmt.step()
} finally {
_stmt.close()
}
}
}
public companion object {
public fun getRequiredConverters(): List<KClass<*>> = emptyList()
}
}
@@ -0,0 +1,222 @@
package com.crsmthw.phase10tracker.`data`.db
import androidx.room.EntityDeleteOrUpdateAdapter
import androidx.room.EntityInsertAdapter
import androidx.room.RoomDatabase
import androidx.room.coroutines.createFlow
import androidx.room.util.getColumnIndexOrThrow
import androidx.room.util.performSuspending
import androidx.sqlite.SQLiteStatement
import com.crsmthw.phase10tracker.`data`.model.GamePlayerEntity
import javax.`annotation`.processing.Generated
import kotlin.Boolean
import kotlin.Int
import kotlin.Long
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.MutableList
import kotlin.collections.mutableListOf
import kotlin.reflect.KClass
import kotlinx.coroutines.flow.Flow
@Generated(value = ["androidx.room.RoomProcessor"])
@Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"])
public class GamePlayerDao_Impl(
__db: RoomDatabase,
) : GamePlayerDao {
private val __db: RoomDatabase
private val __insertAdapterOfGamePlayerEntity: EntityInsertAdapter<GamePlayerEntity>
private val __updateAdapterOfGamePlayerEntity: EntityDeleteOrUpdateAdapter<GamePlayerEntity>
init {
this.__db = __db
this.__insertAdapterOfGamePlayerEntity = object : EntityInsertAdapter<GamePlayerEntity>() {
protected override fun createQuery(): String = "INSERT OR REPLACE INTO `game_players` (`id`,`gameId`,`playerId`,`playerName`,`turnOrder`,`currentPhase`,`totalScore`,`isEliminated`) VALUES (nullif(?, 0),?,?,?,?,?,?,?)"
protected override fun bind(statement: SQLiteStatement, entity: GamePlayerEntity) {
statement.bindLong(1, entity.id)
statement.bindLong(2, entity.gameId)
statement.bindLong(3, entity.playerId)
statement.bindText(4, entity.playerName)
statement.bindLong(5, entity.turnOrder.toLong())
statement.bindLong(6, entity.currentPhase.toLong())
statement.bindLong(7, entity.totalScore.toLong())
val _tmp: Int = if (entity.isEliminated) 1 else 0
statement.bindLong(8, _tmp.toLong())
}
}
this.__updateAdapterOfGamePlayerEntity = object : EntityDeleteOrUpdateAdapter<GamePlayerEntity>() {
protected override fun createQuery(): String = "UPDATE OR ABORT `game_players` SET `id` = ?,`gameId` = ?,`playerId` = ?,`playerName` = ?,`turnOrder` = ?,`currentPhase` = ?,`totalScore` = ?,`isEliminated` = ? WHERE `id` = ?"
protected override fun bind(statement: SQLiteStatement, entity: GamePlayerEntity) {
statement.bindLong(1, entity.id)
statement.bindLong(2, entity.gameId)
statement.bindLong(3, entity.playerId)
statement.bindText(4, entity.playerName)
statement.bindLong(5, entity.turnOrder.toLong())
statement.bindLong(6, entity.currentPhase.toLong())
statement.bindLong(7, entity.totalScore.toLong())
val _tmp: Int = if (entity.isEliminated) 1 else 0
statement.bindLong(8, _tmp.toLong())
statement.bindLong(9, entity.id)
}
}
}
public override suspend fun insertGamePlayers(players: List<GamePlayerEntity>): Unit = performSuspending(__db, false, true) { _connection ->
__insertAdapterOfGamePlayerEntity.insert(_connection, players)
}
public override suspend fun updateGamePlayer(player: GamePlayerEntity): Unit = performSuspending(__db, false, true) { _connection ->
__updateAdapterOfGamePlayerEntity.handle(_connection, player)
}
public override suspend fun updateGamePlayers(players: List<GamePlayerEntity>): Unit = performSuspending(__db, false, true) { _connection ->
__updateAdapterOfGamePlayerEntity.handleMultiple(_connection, players)
}
public override fun getGamePlayers(gameId: Long): Flow<List<GamePlayerEntity>> {
val _sql: String = "SELECT * FROM game_players WHERE gameId = ? ORDER BY turnOrder ASC"
return createFlow(__db, false, arrayOf("game_players")) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
var _argIndex: Int = 1
_stmt.bindLong(_argIndex, gameId)
val _columnIndexOfId: Int = getColumnIndexOrThrow(_stmt, "id")
val _columnIndexOfGameId: Int = getColumnIndexOrThrow(_stmt, "gameId")
val _columnIndexOfPlayerId: Int = getColumnIndexOrThrow(_stmt, "playerId")
val _columnIndexOfPlayerName: Int = getColumnIndexOrThrow(_stmt, "playerName")
val _columnIndexOfTurnOrder: Int = getColumnIndexOrThrow(_stmt, "turnOrder")
val _columnIndexOfCurrentPhase: Int = getColumnIndexOrThrow(_stmt, "currentPhase")
val _columnIndexOfTotalScore: Int = getColumnIndexOrThrow(_stmt, "totalScore")
val _columnIndexOfIsEliminated: Int = getColumnIndexOrThrow(_stmt, "isEliminated")
val _result: MutableList<GamePlayerEntity> = mutableListOf()
while (_stmt.step()) {
val _item: GamePlayerEntity
val _tmpId: Long
_tmpId = _stmt.getLong(_columnIndexOfId)
val _tmpGameId: Long
_tmpGameId = _stmt.getLong(_columnIndexOfGameId)
val _tmpPlayerId: Long
_tmpPlayerId = _stmt.getLong(_columnIndexOfPlayerId)
val _tmpPlayerName: String
_tmpPlayerName = _stmt.getText(_columnIndexOfPlayerName)
val _tmpTurnOrder: Int
_tmpTurnOrder = _stmt.getLong(_columnIndexOfTurnOrder).toInt()
val _tmpCurrentPhase: Int
_tmpCurrentPhase = _stmt.getLong(_columnIndexOfCurrentPhase).toInt()
val _tmpTotalScore: Int
_tmpTotalScore = _stmt.getLong(_columnIndexOfTotalScore).toInt()
val _tmpIsEliminated: Boolean
val _tmp: Int
_tmp = _stmt.getLong(_columnIndexOfIsEliminated).toInt()
_tmpIsEliminated = _tmp != 0
_item = GamePlayerEntity(_tmpId,_tmpGameId,_tmpPlayerId,_tmpPlayerName,_tmpTurnOrder,_tmpCurrentPhase,_tmpTotalScore,_tmpIsEliminated)
_result.add(_item)
}
_result
} finally {
_stmt.close()
}
}
}
public override suspend fun getGamePlayersList(gameId: Long): List<GamePlayerEntity> {
val _sql: String = "SELECT * FROM game_players WHERE gameId = ? ORDER BY turnOrder ASC"
return performSuspending(__db, true, false) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
var _argIndex: Int = 1
_stmt.bindLong(_argIndex, gameId)
val _columnIndexOfId: Int = getColumnIndexOrThrow(_stmt, "id")
val _columnIndexOfGameId: Int = getColumnIndexOrThrow(_stmt, "gameId")
val _columnIndexOfPlayerId: Int = getColumnIndexOrThrow(_stmt, "playerId")
val _columnIndexOfPlayerName: Int = getColumnIndexOrThrow(_stmt, "playerName")
val _columnIndexOfTurnOrder: Int = getColumnIndexOrThrow(_stmt, "turnOrder")
val _columnIndexOfCurrentPhase: Int = getColumnIndexOrThrow(_stmt, "currentPhase")
val _columnIndexOfTotalScore: Int = getColumnIndexOrThrow(_stmt, "totalScore")
val _columnIndexOfIsEliminated: Int = getColumnIndexOrThrow(_stmt, "isEliminated")
val _result: MutableList<GamePlayerEntity> = mutableListOf()
while (_stmt.step()) {
val _item: GamePlayerEntity
val _tmpId: Long
_tmpId = _stmt.getLong(_columnIndexOfId)
val _tmpGameId: Long
_tmpGameId = _stmt.getLong(_columnIndexOfGameId)
val _tmpPlayerId: Long
_tmpPlayerId = _stmt.getLong(_columnIndexOfPlayerId)
val _tmpPlayerName: String
_tmpPlayerName = _stmt.getText(_columnIndexOfPlayerName)
val _tmpTurnOrder: Int
_tmpTurnOrder = _stmt.getLong(_columnIndexOfTurnOrder).toInt()
val _tmpCurrentPhase: Int
_tmpCurrentPhase = _stmt.getLong(_columnIndexOfCurrentPhase).toInt()
val _tmpTotalScore: Int
_tmpTotalScore = _stmt.getLong(_columnIndexOfTotalScore).toInt()
val _tmpIsEliminated: Boolean
val _tmp: Int
_tmp = _stmt.getLong(_columnIndexOfIsEliminated).toInt()
_tmpIsEliminated = _tmp != 0
_item = GamePlayerEntity(_tmpId,_tmpGameId,_tmpPlayerId,_tmpPlayerName,_tmpTurnOrder,_tmpCurrentPhase,_tmpTotalScore,_tmpIsEliminated)
_result.add(_item)
}
_result
} finally {
_stmt.close()
}
}
}
public override suspend fun getGamePlayerById(id: Long): GamePlayerEntity? {
val _sql: String = "SELECT * FROM game_players WHERE id = ?"
return performSuspending(__db, true, false) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
var _argIndex: Int = 1
_stmt.bindLong(_argIndex, id)
val _columnIndexOfId: Int = getColumnIndexOrThrow(_stmt, "id")
val _columnIndexOfGameId: Int = getColumnIndexOrThrow(_stmt, "gameId")
val _columnIndexOfPlayerId: Int = getColumnIndexOrThrow(_stmt, "playerId")
val _columnIndexOfPlayerName: Int = getColumnIndexOrThrow(_stmt, "playerName")
val _columnIndexOfTurnOrder: Int = getColumnIndexOrThrow(_stmt, "turnOrder")
val _columnIndexOfCurrentPhase: Int = getColumnIndexOrThrow(_stmt, "currentPhase")
val _columnIndexOfTotalScore: Int = getColumnIndexOrThrow(_stmt, "totalScore")
val _columnIndexOfIsEliminated: Int = getColumnIndexOrThrow(_stmt, "isEliminated")
val _result: GamePlayerEntity?
if (_stmt.step()) {
val _tmpId: Long
_tmpId = _stmt.getLong(_columnIndexOfId)
val _tmpGameId: Long
_tmpGameId = _stmt.getLong(_columnIndexOfGameId)
val _tmpPlayerId: Long
_tmpPlayerId = _stmt.getLong(_columnIndexOfPlayerId)
val _tmpPlayerName: String
_tmpPlayerName = _stmt.getText(_columnIndexOfPlayerName)
val _tmpTurnOrder: Int
_tmpTurnOrder = _stmt.getLong(_columnIndexOfTurnOrder).toInt()
val _tmpCurrentPhase: Int
_tmpCurrentPhase = _stmt.getLong(_columnIndexOfCurrentPhase).toInt()
val _tmpTotalScore: Int
_tmpTotalScore = _stmt.getLong(_columnIndexOfTotalScore).toInt()
val _tmpIsEliminated: Boolean
val _tmp: Int
_tmp = _stmt.getLong(_columnIndexOfIsEliminated).toInt()
_tmpIsEliminated = _tmp != 0
_result = GamePlayerEntity(_tmpId,_tmpGameId,_tmpPlayerId,_tmpPlayerName,_tmpTurnOrder,_tmpCurrentPhase,_tmpTotalScore,_tmpIsEliminated)
} else {
_result = null
}
_result
} finally {
_stmt.close()
}
}
}
public companion object {
public fun getRequiredConverters(): List<KClass<*>> = emptyList()
}
}
@@ -0,0 +1,244 @@
package com.crsmthw.phase10tracker.`data`.db
import androidx.room.InvalidationTracker
import androidx.room.RoomOpenDelegate
import androidx.room.migration.AutoMigrationSpec
import androidx.room.migration.Migration
import androidx.room.util.TableInfo
import androidx.room.util.TableInfo.Companion.read
import androidx.room.util.dropFtsSyncTriggers
import androidx.sqlite.SQLiteConnection
import androidx.sqlite.execSQL
import javax.`annotation`.processing.Generated
import kotlin.Lazy
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.collections.MutableList
import kotlin.collections.MutableMap
import kotlin.collections.MutableSet
import kotlin.collections.Set
import kotlin.collections.mutableListOf
import kotlin.collections.mutableMapOf
import kotlin.collections.mutableSetOf
import kotlin.reflect.KClass
@Generated(value = ["androidx.room.RoomProcessor"])
@Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"])
public class Phase10Database_Impl : Phase10Database() {
private val _playerDao: Lazy<PlayerDao> = lazy {
PlayerDao_Impl(this)
}
private val _gameDao: Lazy<GameDao> = lazy {
GameDao_Impl(this)
}
private val _gamePlayerDao: Lazy<GamePlayerDao> = lazy {
GamePlayerDao_Impl(this)
}
private val _roundDao: Lazy<RoundDao> = lazy {
RoundDao_Impl(this)
}
private val _customRuleSetDao: Lazy<CustomRuleSetDao> = lazy {
CustomRuleSetDao_Impl(this)
}
protected override fun createOpenDelegate(): RoomOpenDelegate {
val _openDelegate: RoomOpenDelegate = object : RoomOpenDelegate(2, "be786709a45966a71ad994200bfac1b8", "51f981e3a9729a09288d6faabd6b815f") {
public override fun createAllTables(connection: SQLiteConnection) {
connection.execSQL("CREATE TABLE IF NOT EXISTS `players` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT NOT NULL, `gamesPlayed` INTEGER NOT NULL, `gamesWon` INTEGER NOT NULL, `createdAt` INTEGER NOT NULL)")
connection.execSQL("CREATE TABLE IF NOT EXISTS `games` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `startedAt` INTEGER NOT NULL, `finishedAt` INTEGER, `isComplete` INTEGER NOT NULL, `winnerId` INTEGER, `currentRound` INTEGER NOT NULL, `currentDealerIndex` INTEGER NOT NULL)")
connection.execSQL("CREATE TABLE IF NOT EXISTS `game_players` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `gameId` INTEGER NOT NULL, `playerId` INTEGER NOT NULL, `playerName` TEXT NOT NULL, `turnOrder` INTEGER NOT NULL, `currentPhase` INTEGER NOT NULL, `totalScore` INTEGER NOT NULL, `isEliminated` INTEGER NOT NULL, FOREIGN KEY(`gameId`) REFERENCES `games`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`playerId`) REFERENCES `players`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )")
connection.execSQL("CREATE INDEX IF NOT EXISTS `index_game_players_gameId` ON `game_players` (`gameId`)")
connection.execSQL("CREATE INDEX IF NOT EXISTS `index_game_players_playerId` ON `game_players` (`playerId`)")
connection.execSQL("CREATE TABLE IF NOT EXISTS `rounds` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `gameId` INTEGER NOT NULL, `gamePlayerId` INTEGER NOT NULL, `roundNumber` INTEGER NOT NULL, `score` INTEGER NOT NULL, `phaseCompleted` INTEGER NOT NULL, `phaseAtRoundStart` INTEGER NOT NULL, FOREIGN KEY(`gameId`) REFERENCES `games`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`gamePlayerId`) REFERENCES `game_players`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )")
connection.execSQL("CREATE INDEX IF NOT EXISTS `index_rounds_gameId` ON `rounds` (`gameId`)")
connection.execSQL("CREATE INDEX IF NOT EXISTS `index_rounds_gamePlayerId` ON `rounds` (`gamePlayerId`)")
connection.execSQL("CREATE TABLE IF NOT EXISTS `custom_rule_sets` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT NOT NULL, `rulesJson` TEXT NOT NULL, `createdAt` INTEGER NOT NULL)")
connection.execSQL("CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)")
connection.execSQL("INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'be786709a45966a71ad994200bfac1b8')")
}
public override fun dropAllTables(connection: SQLiteConnection) {
connection.execSQL("DROP TABLE IF EXISTS `players`")
connection.execSQL("DROP TABLE IF EXISTS `games`")
connection.execSQL("DROP TABLE IF EXISTS `game_players`")
connection.execSQL("DROP TABLE IF EXISTS `rounds`")
connection.execSQL("DROP TABLE IF EXISTS `custom_rule_sets`")
}
public override fun onCreate(connection: SQLiteConnection) {
}
public override fun onOpen(connection: SQLiteConnection) {
connection.execSQL("PRAGMA foreign_keys = ON")
internalInitInvalidationTracker(connection)
}
public override fun onPreMigrate(connection: SQLiteConnection) {
dropFtsSyncTriggers(connection)
}
public override fun onPostMigrate(connection: SQLiteConnection) {
}
public override fun onValidateSchema(connection: SQLiteConnection): RoomOpenDelegate.ValidationResult {
val _columnsPlayers: MutableMap<String, TableInfo.Column> = mutableMapOf()
_columnsPlayers.put("id", TableInfo.Column("id", "INTEGER", true, 1, null, TableInfo.CREATED_FROM_ENTITY))
_columnsPlayers.put("name", TableInfo.Column("name", "TEXT", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsPlayers.put("gamesPlayed", TableInfo.Column("gamesPlayed", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsPlayers.put("gamesWon", TableInfo.Column("gamesWon", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsPlayers.put("createdAt", TableInfo.Column("createdAt", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
val _foreignKeysPlayers: MutableSet<TableInfo.ForeignKey> = mutableSetOf()
val _indicesPlayers: MutableSet<TableInfo.Index> = mutableSetOf()
val _infoPlayers: TableInfo = TableInfo("players", _columnsPlayers, _foreignKeysPlayers, _indicesPlayers)
val _existingPlayers: TableInfo = read(connection, "players")
if (!_infoPlayers.equals(_existingPlayers)) {
return RoomOpenDelegate.ValidationResult(false, """
|players(com.crsmthw.phase10tracker.data.model.PlayerEntity).
| Expected:
|""".trimMargin() + _infoPlayers + """
|
| Found:
|""".trimMargin() + _existingPlayers)
}
val _columnsGames: MutableMap<String, TableInfo.Column> = mutableMapOf()
_columnsGames.put("id", TableInfo.Column("id", "INTEGER", true, 1, null, TableInfo.CREATED_FROM_ENTITY))
_columnsGames.put("startedAt", TableInfo.Column("startedAt", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsGames.put("finishedAt", TableInfo.Column("finishedAt", "INTEGER", false, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsGames.put("isComplete", TableInfo.Column("isComplete", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsGames.put("winnerId", TableInfo.Column("winnerId", "INTEGER", false, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsGames.put("currentRound", TableInfo.Column("currentRound", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsGames.put("currentDealerIndex", TableInfo.Column("currentDealerIndex", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
val _foreignKeysGames: MutableSet<TableInfo.ForeignKey> = mutableSetOf()
val _indicesGames: MutableSet<TableInfo.Index> = mutableSetOf()
val _infoGames: TableInfo = TableInfo("games", _columnsGames, _foreignKeysGames, _indicesGames)
val _existingGames: TableInfo = read(connection, "games")
if (!_infoGames.equals(_existingGames)) {
return RoomOpenDelegate.ValidationResult(false, """
|games(com.crsmthw.phase10tracker.data.model.GameEntity).
| Expected:
|""".trimMargin() + _infoGames + """
|
| Found:
|""".trimMargin() + _existingGames)
}
val _columnsGamePlayers: MutableMap<String, TableInfo.Column> = mutableMapOf()
_columnsGamePlayers.put("id", TableInfo.Column("id", "INTEGER", true, 1, null, TableInfo.CREATED_FROM_ENTITY))
_columnsGamePlayers.put("gameId", TableInfo.Column("gameId", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsGamePlayers.put("playerId", TableInfo.Column("playerId", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsGamePlayers.put("playerName", TableInfo.Column("playerName", "TEXT", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsGamePlayers.put("turnOrder", TableInfo.Column("turnOrder", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsGamePlayers.put("currentPhase", TableInfo.Column("currentPhase", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsGamePlayers.put("totalScore", TableInfo.Column("totalScore", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsGamePlayers.put("isEliminated", TableInfo.Column("isEliminated", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
val _foreignKeysGamePlayers: MutableSet<TableInfo.ForeignKey> = mutableSetOf()
_foreignKeysGamePlayers.add(TableInfo.ForeignKey("games", "CASCADE", "NO ACTION", listOf("gameId"), listOf("id")))
_foreignKeysGamePlayers.add(TableInfo.ForeignKey("players", "CASCADE", "NO ACTION", listOf("playerId"), listOf("id")))
val _indicesGamePlayers: MutableSet<TableInfo.Index> = mutableSetOf()
_indicesGamePlayers.add(TableInfo.Index("index_game_players_gameId", false, listOf("gameId"), listOf("ASC")))
_indicesGamePlayers.add(TableInfo.Index("index_game_players_playerId", false, listOf("playerId"), listOf("ASC")))
val _infoGamePlayers: TableInfo = TableInfo("game_players", _columnsGamePlayers, _foreignKeysGamePlayers, _indicesGamePlayers)
val _existingGamePlayers: TableInfo = read(connection, "game_players")
if (!_infoGamePlayers.equals(_existingGamePlayers)) {
return RoomOpenDelegate.ValidationResult(false, """
|game_players(com.crsmthw.phase10tracker.data.model.GamePlayerEntity).
| Expected:
|""".trimMargin() + _infoGamePlayers + """
|
| Found:
|""".trimMargin() + _existingGamePlayers)
}
val _columnsRounds: MutableMap<String, TableInfo.Column> = mutableMapOf()
_columnsRounds.put("id", TableInfo.Column("id", "INTEGER", true, 1, null, TableInfo.CREATED_FROM_ENTITY))
_columnsRounds.put("gameId", TableInfo.Column("gameId", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsRounds.put("gamePlayerId", TableInfo.Column("gamePlayerId", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsRounds.put("roundNumber", TableInfo.Column("roundNumber", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsRounds.put("score", TableInfo.Column("score", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsRounds.put("phaseCompleted", TableInfo.Column("phaseCompleted", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsRounds.put("phaseAtRoundStart", TableInfo.Column("phaseAtRoundStart", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
val _foreignKeysRounds: MutableSet<TableInfo.ForeignKey> = mutableSetOf()
_foreignKeysRounds.add(TableInfo.ForeignKey("games", "CASCADE", "NO ACTION", listOf("gameId"), listOf("id")))
_foreignKeysRounds.add(TableInfo.ForeignKey("game_players", "CASCADE", "NO ACTION", listOf("gamePlayerId"), listOf("id")))
val _indicesRounds: MutableSet<TableInfo.Index> = mutableSetOf()
_indicesRounds.add(TableInfo.Index("index_rounds_gameId", false, listOf("gameId"), listOf("ASC")))
_indicesRounds.add(TableInfo.Index("index_rounds_gamePlayerId", false, listOf("gamePlayerId"), listOf("ASC")))
val _infoRounds: TableInfo = TableInfo("rounds", _columnsRounds, _foreignKeysRounds, _indicesRounds)
val _existingRounds: TableInfo = read(connection, "rounds")
if (!_infoRounds.equals(_existingRounds)) {
return RoomOpenDelegate.ValidationResult(false, """
|rounds(com.crsmthw.phase10tracker.data.model.RoundEntity).
| Expected:
|""".trimMargin() + _infoRounds + """
|
| Found:
|""".trimMargin() + _existingRounds)
}
val _columnsCustomRuleSets: MutableMap<String, TableInfo.Column> = mutableMapOf()
_columnsCustomRuleSets.put("id", TableInfo.Column("id", "INTEGER", true, 1, null, TableInfo.CREATED_FROM_ENTITY))
_columnsCustomRuleSets.put("name", TableInfo.Column("name", "TEXT", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsCustomRuleSets.put("rulesJson", TableInfo.Column("rulesJson", "TEXT", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
_columnsCustomRuleSets.put("createdAt", TableInfo.Column("createdAt", "INTEGER", true, 0, null, TableInfo.CREATED_FROM_ENTITY))
val _foreignKeysCustomRuleSets: MutableSet<TableInfo.ForeignKey> = mutableSetOf()
val _indicesCustomRuleSets: MutableSet<TableInfo.Index> = mutableSetOf()
val _infoCustomRuleSets: TableInfo = TableInfo("custom_rule_sets", _columnsCustomRuleSets, _foreignKeysCustomRuleSets, _indicesCustomRuleSets)
val _existingCustomRuleSets: TableInfo = read(connection, "custom_rule_sets")
if (!_infoCustomRuleSets.equals(_existingCustomRuleSets)) {
return RoomOpenDelegate.ValidationResult(false, """
|custom_rule_sets(com.crsmthw.phase10tracker.data.model.CustomRuleSetEntity).
| Expected:
|""".trimMargin() + _infoCustomRuleSets + """
|
| Found:
|""".trimMargin() + _existingCustomRuleSets)
}
return RoomOpenDelegate.ValidationResult(true, null)
}
}
return _openDelegate
}
protected override fun createInvalidationTracker(): InvalidationTracker {
val _shadowTablesMap: MutableMap<String, String> = mutableMapOf()
val _viewTables: MutableMap<String, Set<String>> = mutableMapOf()
return InvalidationTracker(this, _shadowTablesMap, _viewTables, "players", "games", "game_players", "rounds", "custom_rule_sets")
}
public override fun clearAllTables() {
super.performClear(true, "players", "games", "game_players", "rounds", "custom_rule_sets")
}
protected override fun getRequiredTypeConverterClasses(): Map<KClass<*>, List<KClass<*>>> {
val _typeConvertersMap: MutableMap<KClass<*>, List<KClass<*>>> = mutableMapOf()
_typeConvertersMap.put(PlayerDao::class, PlayerDao_Impl.getRequiredConverters())
_typeConvertersMap.put(GameDao::class, GameDao_Impl.getRequiredConverters())
_typeConvertersMap.put(GamePlayerDao::class, GamePlayerDao_Impl.getRequiredConverters())
_typeConvertersMap.put(RoundDao::class, RoundDao_Impl.getRequiredConverters())
_typeConvertersMap.put(CustomRuleSetDao::class, CustomRuleSetDao_Impl.getRequiredConverters())
return _typeConvertersMap
}
public override fun getRequiredAutoMigrationSpecClasses(): Set<KClass<out AutoMigrationSpec>> {
val _autoMigrationSpecsSet: MutableSet<KClass<out AutoMigrationSpec>> = mutableSetOf()
return _autoMigrationSpecsSet
}
public override fun createAutoMigrations(autoMigrationSpecs: Map<KClass<out AutoMigrationSpec>, AutoMigrationSpec>): List<Migration> {
val _autoMigrations: MutableList<Migration> = mutableListOf()
return _autoMigrations
}
public override fun playerDao(): PlayerDao = _playerDao.value
public override fun gameDao(): GameDao = _gameDao.value
public override fun gamePlayerDao(): GamePlayerDao = _gamePlayerDao.value
public override fun roundDao(): RoundDao = _roundDao.value
public override fun customRuleSetDao(): CustomRuleSetDao = _customRuleSetDao.value
}
@@ -0,0 +1,191 @@
package com.crsmthw.phase10tracker.`data`.db
import androidx.room.EntityDeleteOrUpdateAdapter
import androidx.room.EntityInsertAdapter
import androidx.room.RoomDatabase
import androidx.room.coroutines.createFlow
import androidx.room.util.appendPlaceholders
import androidx.room.util.getColumnIndexOrThrow
import androidx.room.util.performSuspending
import androidx.sqlite.SQLiteStatement
import com.crsmthw.phase10tracker.`data`.model.PlayerEntity
import javax.`annotation`.processing.Generated
import kotlin.Int
import kotlin.Long
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.MutableList
import kotlin.collections.mutableListOf
import kotlin.reflect.KClass
import kotlin.text.StringBuilder
import kotlinx.coroutines.flow.Flow
@Generated(value = ["androidx.room.RoomProcessor"])
@Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"])
public class PlayerDao_Impl(
__db: RoomDatabase,
) : PlayerDao {
private val __db: RoomDatabase
private val __insertAdapterOfPlayerEntity: EntityInsertAdapter<PlayerEntity>
private val __deleteAdapterOfPlayerEntity: EntityDeleteOrUpdateAdapter<PlayerEntity>
private val __updateAdapterOfPlayerEntity: EntityDeleteOrUpdateAdapter<PlayerEntity>
init {
this.__db = __db
this.__insertAdapterOfPlayerEntity = object : EntityInsertAdapter<PlayerEntity>() {
protected override fun createQuery(): String = "INSERT OR REPLACE INTO `players` (`id`,`name`,`gamesPlayed`,`gamesWon`,`createdAt`) VALUES (nullif(?, 0),?,?,?,?)"
protected override fun bind(statement: SQLiteStatement, entity: PlayerEntity) {
statement.bindLong(1, entity.id)
statement.bindText(2, entity.name)
statement.bindLong(3, entity.gamesPlayed.toLong())
statement.bindLong(4, entity.gamesWon.toLong())
statement.bindLong(5, entity.createdAt)
}
}
this.__deleteAdapterOfPlayerEntity = object : EntityDeleteOrUpdateAdapter<PlayerEntity>() {
protected override fun createQuery(): String = "DELETE FROM `players` WHERE `id` = ?"
protected override fun bind(statement: SQLiteStatement, entity: PlayerEntity) {
statement.bindLong(1, entity.id)
}
}
this.__updateAdapterOfPlayerEntity = object : EntityDeleteOrUpdateAdapter<PlayerEntity>() {
protected override fun createQuery(): String = "UPDATE OR ABORT `players` SET `id` = ?,`name` = ?,`gamesPlayed` = ?,`gamesWon` = ?,`createdAt` = ? WHERE `id` = ?"
protected override fun bind(statement: SQLiteStatement, entity: PlayerEntity) {
statement.bindLong(1, entity.id)
statement.bindText(2, entity.name)
statement.bindLong(3, entity.gamesPlayed.toLong())
statement.bindLong(4, entity.gamesWon.toLong())
statement.bindLong(5, entity.createdAt)
statement.bindLong(6, entity.id)
}
}
}
public override suspend fun insertPlayer(player: PlayerEntity): Long = performSuspending(__db, false, true) { _connection ->
val _result: Long = __insertAdapterOfPlayerEntity.insertAndReturnId(_connection, player)
_result
}
public override suspend fun deletePlayer(player: PlayerEntity): Unit = performSuspending(__db, false, true) { _connection ->
__deleteAdapterOfPlayerEntity.handle(_connection, player)
}
public override suspend fun updatePlayer(player: PlayerEntity): Unit = performSuspending(__db, false, true) { _connection ->
__updateAdapterOfPlayerEntity.handle(_connection, player)
}
public override fun getAllPlayers(): Flow<List<PlayerEntity>> {
val _sql: String = "SELECT * FROM players ORDER BY name ASC"
return createFlow(__db, false, arrayOf("players")) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
val _columnIndexOfId: Int = getColumnIndexOrThrow(_stmt, "id")
val _columnIndexOfName: Int = getColumnIndexOrThrow(_stmt, "name")
val _columnIndexOfGamesPlayed: Int = getColumnIndexOrThrow(_stmt, "gamesPlayed")
val _columnIndexOfGamesWon: Int = getColumnIndexOrThrow(_stmt, "gamesWon")
val _columnIndexOfCreatedAt: Int = getColumnIndexOrThrow(_stmt, "createdAt")
val _result: MutableList<PlayerEntity> = mutableListOf()
while (_stmt.step()) {
val _item: PlayerEntity
val _tmpId: Long
_tmpId = _stmt.getLong(_columnIndexOfId)
val _tmpName: String
_tmpName = _stmt.getText(_columnIndexOfName)
val _tmpGamesPlayed: Int
_tmpGamesPlayed = _stmt.getLong(_columnIndexOfGamesPlayed).toInt()
val _tmpGamesWon: Int
_tmpGamesWon = _stmt.getLong(_columnIndexOfGamesWon).toInt()
val _tmpCreatedAt: Long
_tmpCreatedAt = _stmt.getLong(_columnIndexOfCreatedAt)
_item = PlayerEntity(_tmpId,_tmpName,_tmpGamesPlayed,_tmpGamesWon,_tmpCreatedAt)
_result.add(_item)
}
_result
} finally {
_stmt.close()
}
}
}
public override suspend fun getPlayerById(id: Long): PlayerEntity? {
val _sql: String = "SELECT * FROM players WHERE id = ?"
return performSuspending(__db, true, false) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
var _argIndex: Int = 1
_stmt.bindLong(_argIndex, id)
val _columnIndexOfId: Int = getColumnIndexOrThrow(_stmt, "id")
val _columnIndexOfName: Int = getColumnIndexOrThrow(_stmt, "name")
val _columnIndexOfGamesPlayed: Int = getColumnIndexOrThrow(_stmt, "gamesPlayed")
val _columnIndexOfGamesWon: Int = getColumnIndexOrThrow(_stmt, "gamesWon")
val _columnIndexOfCreatedAt: Int = getColumnIndexOrThrow(_stmt, "createdAt")
val _result: PlayerEntity?
if (_stmt.step()) {
val _tmpId: Long
_tmpId = _stmt.getLong(_columnIndexOfId)
val _tmpName: String
_tmpName = _stmt.getText(_columnIndexOfName)
val _tmpGamesPlayed: Int
_tmpGamesPlayed = _stmt.getLong(_columnIndexOfGamesPlayed).toInt()
val _tmpGamesWon: Int
_tmpGamesWon = _stmt.getLong(_columnIndexOfGamesWon).toInt()
val _tmpCreatedAt: Long
_tmpCreatedAt = _stmt.getLong(_columnIndexOfCreatedAt)
_result = PlayerEntity(_tmpId,_tmpName,_tmpGamesPlayed,_tmpGamesWon,_tmpCreatedAt)
} else {
_result = null
}
_result
} finally {
_stmt.close()
}
}
}
public override suspend fun incrementGamesPlayed(ids: List<Long>) {
val _stringBuilder: StringBuilder = StringBuilder()
_stringBuilder.append("UPDATE players SET gamesPlayed = gamesPlayed + 1 WHERE id IN (")
val _inputSize: Int = ids.size
appendPlaceholders(_stringBuilder, _inputSize)
_stringBuilder.append(")")
val _sql: String = _stringBuilder.toString()
return performSuspending(__db, false, true) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
var _argIndex: Int = 1
for (_item: Long in ids) {
_stmt.bindLong(_argIndex, _item)
_argIndex++
}
_stmt.step()
} finally {
_stmt.close()
}
}
}
public override suspend fun incrementGamesWon(id: Long) {
val _sql: String = "UPDATE players SET gamesWon = gamesWon + 1 WHERE id = ?"
return performSuspending(__db, false, true) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
var _argIndex: Int = 1
_stmt.bindLong(_argIndex, id)
_stmt.step()
} finally {
_stmt.close()
}
}
}
public companion object {
public fun getRequiredConverters(): List<KClass<*>> = emptyList()
}
}
@@ -0,0 +1,142 @@
package com.crsmthw.phase10tracker.`data`.db
import androidx.room.EntityInsertAdapter
import androidx.room.RoomDatabase
import androidx.room.coroutines.createFlow
import androidx.room.util.getColumnIndexOrThrow
import androidx.room.util.performSuspending
import androidx.sqlite.SQLiteStatement
import com.crsmthw.phase10tracker.`data`.model.RoundEntity
import javax.`annotation`.processing.Generated
import kotlin.Boolean
import kotlin.Int
import kotlin.Long
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.MutableList
import kotlin.collections.mutableListOf
import kotlin.reflect.KClass
import kotlinx.coroutines.flow.Flow
@Generated(value = ["androidx.room.RoomProcessor"])
@Suppress(names = ["UNCHECKED_CAST", "DEPRECATION", "REDUNDANT_PROJECTION", "REMOVAL"])
public class RoundDao_Impl(
__db: RoomDatabase,
) : RoundDao {
private val __db: RoomDatabase
private val __insertAdapterOfRoundEntity: EntityInsertAdapter<RoundEntity>
init {
this.__db = __db
this.__insertAdapterOfRoundEntity = object : EntityInsertAdapter<RoundEntity>() {
protected override fun createQuery(): String = "INSERT OR REPLACE INTO `rounds` (`id`,`gameId`,`gamePlayerId`,`roundNumber`,`score`,`phaseCompleted`,`phaseAtRoundStart`) VALUES (nullif(?, 0),?,?,?,?,?,?)"
protected override fun bind(statement: SQLiteStatement, entity: RoundEntity) {
statement.bindLong(1, entity.id)
statement.bindLong(2, entity.gameId)
statement.bindLong(3, entity.gamePlayerId)
statement.bindLong(4, entity.roundNumber.toLong())
statement.bindLong(5, entity.score.toLong())
val _tmp: Int = if (entity.phaseCompleted) 1 else 0
statement.bindLong(6, _tmp.toLong())
statement.bindLong(7, entity.phaseAtRoundStart.toLong())
}
}
}
public override suspend fun insertRounds(rounds: List<RoundEntity>): Unit = performSuspending(__db, false, true) { _connection ->
__insertAdapterOfRoundEntity.insert(_connection, rounds)
}
public override fun getRoundsForGame(gameId: Long): Flow<List<RoundEntity>> {
val _sql: String = "SELECT * FROM rounds WHERE gameId = ? ORDER BY roundNumber ASC"
return createFlow(__db, false, arrayOf("rounds")) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
var _argIndex: Int = 1
_stmt.bindLong(_argIndex, gameId)
val _columnIndexOfId: Int = getColumnIndexOrThrow(_stmt, "id")
val _columnIndexOfGameId: Int = getColumnIndexOrThrow(_stmt, "gameId")
val _columnIndexOfGamePlayerId: Int = getColumnIndexOrThrow(_stmt, "gamePlayerId")
val _columnIndexOfRoundNumber: Int = getColumnIndexOrThrow(_stmt, "roundNumber")
val _columnIndexOfScore: Int = getColumnIndexOrThrow(_stmt, "score")
val _columnIndexOfPhaseCompleted: Int = getColumnIndexOrThrow(_stmt, "phaseCompleted")
val _columnIndexOfPhaseAtRoundStart: Int = getColumnIndexOrThrow(_stmt, "phaseAtRoundStart")
val _result: MutableList<RoundEntity> = mutableListOf()
while (_stmt.step()) {
val _item: RoundEntity
val _tmpId: Long
_tmpId = _stmt.getLong(_columnIndexOfId)
val _tmpGameId: Long
_tmpGameId = _stmt.getLong(_columnIndexOfGameId)
val _tmpGamePlayerId: Long
_tmpGamePlayerId = _stmt.getLong(_columnIndexOfGamePlayerId)
val _tmpRoundNumber: Int
_tmpRoundNumber = _stmt.getLong(_columnIndexOfRoundNumber).toInt()
val _tmpScore: Int
_tmpScore = _stmt.getLong(_columnIndexOfScore).toInt()
val _tmpPhaseCompleted: Boolean
val _tmp: Int
_tmp = _stmt.getLong(_columnIndexOfPhaseCompleted).toInt()
_tmpPhaseCompleted = _tmp != 0
val _tmpPhaseAtRoundStart: Int
_tmpPhaseAtRoundStart = _stmt.getLong(_columnIndexOfPhaseAtRoundStart).toInt()
_item = RoundEntity(_tmpId,_tmpGameId,_tmpGamePlayerId,_tmpRoundNumber,_tmpScore,_tmpPhaseCompleted,_tmpPhaseAtRoundStart)
_result.add(_item)
}
_result
} finally {
_stmt.close()
}
}
}
public override suspend fun getRoundsForPlayer(gamePlayerId: Long): List<RoundEntity> {
val _sql: String = "SELECT * FROM rounds WHERE gamePlayerId = ? ORDER BY roundNumber ASC"
return performSuspending(__db, true, false) { _connection ->
val _stmt: SQLiteStatement = _connection.prepare(_sql)
try {
var _argIndex: Int = 1
_stmt.bindLong(_argIndex, gamePlayerId)
val _columnIndexOfId: Int = getColumnIndexOrThrow(_stmt, "id")
val _columnIndexOfGameId: Int = getColumnIndexOrThrow(_stmt, "gameId")
val _columnIndexOfGamePlayerId: Int = getColumnIndexOrThrow(_stmt, "gamePlayerId")
val _columnIndexOfRoundNumber: Int = getColumnIndexOrThrow(_stmt, "roundNumber")
val _columnIndexOfScore: Int = getColumnIndexOrThrow(_stmt, "score")
val _columnIndexOfPhaseCompleted: Int = getColumnIndexOrThrow(_stmt, "phaseCompleted")
val _columnIndexOfPhaseAtRoundStart: Int = getColumnIndexOrThrow(_stmt, "phaseAtRoundStart")
val _result: MutableList<RoundEntity> = mutableListOf()
while (_stmt.step()) {
val _item: RoundEntity
val _tmpId: Long
_tmpId = _stmt.getLong(_columnIndexOfId)
val _tmpGameId: Long
_tmpGameId = _stmt.getLong(_columnIndexOfGameId)
val _tmpGamePlayerId: Long
_tmpGamePlayerId = _stmt.getLong(_columnIndexOfGamePlayerId)
val _tmpRoundNumber: Int
_tmpRoundNumber = _stmt.getLong(_columnIndexOfRoundNumber).toInt()
val _tmpScore: Int
_tmpScore = _stmt.getLong(_columnIndexOfScore).toInt()
val _tmpPhaseCompleted: Boolean
val _tmp: Int
_tmp = _stmt.getLong(_columnIndexOfPhaseCompleted).toInt()
_tmpPhaseCompleted = _tmp != 0
val _tmpPhaseAtRoundStart: Int
_tmpPhaseAtRoundStart = _stmt.getLong(_columnIndexOfPhaseAtRoundStart).toInt()
_item = RoundEntity(_tmpId,_tmpGameId,_tmpGamePlayerId,_tmpRoundNumber,_tmpScore,_tmpPhaseCompleted,_tmpPhaseAtRoundStart)
_result.add(_item)
}
_result
} finally {
_stmt.close()
}
}
}
public companion object {
public fun getRequiredConverters(): List<KClass<*>> = emptyList()
}
}
@@ -0,0 +1,7 @@
com.crsmthw.phase10tracker.app-updated_navigation_xml-0 /home/cris/Documents/Phase10Tracker/app/build/generated/updated_navigation_xml/debug
com.crsmthw.phase10tracker.app-packageDebugResources-1 /home/cris/Documents/Phase10Tracker/app/build/intermediates/incremental/debug/packageDebugResources/merged.dir
com.crsmthw.phase10tracker.app-packageDebugResources-2 /home/cris/Documents/Phase10Tracker/app/build/intermediates/incremental/debug/packageDebugResources/stripped.dir
com.crsmthw.phase10tracker.app-debug-3 /home/cris/Documents/Phase10Tracker/app/build/intermediates/merged_res/debug/mergeDebugResources
com.crsmthw.phase10tracker.app-debug-4 /home/cris/Documents/Phase10Tracker/app/src/debug/res
com.crsmthw.phase10tracker.app-main-5 /home/cris/Documents/Phase10Tracker/app/src/main/res
gradleHome-0 /home/cris/.gradle
@@ -0,0 +1 @@
{"room-compiler-2.8.4.jar (androidx.room:room-compiler:2.8.4)":"KSP_PROCESSOR"}
Binary file not shown.
@@ -0,0 +1,21 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.crsmthw.phase10tracker",
"variantName": "debug",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 1,
"versionName": "1.0",
"outputFile": "app-debug.apk"
}
],
"elementType": "File",
"minSdkVersionForDexing": 35
}
@@ -0,0 +1,2 @@
#- File Locator -
listingFile=../../../apk/debug/output-metadata.json
@@ -0,0 +1,2 @@
appMetadataVersion=1.1
androidGradlePluginVersion=9.2.1

Some files were not shown because too many files have changed in this diff Show More