This commit is contained in:
Kelvin 2023-11-16 20:32:15 +01:00
parent 6df8f84421
commit 10e3d2122f
4 changed files with 50 additions and 4 deletions

View file

@ -5,6 +5,7 @@ plugins {
id 'org.ajoberstar.grgit' version '1.7.2'
id 'com.google.protobuf'
id 'kotlin-parcelize'
id 'kotlin-kapt'
}
ext {
@ -194,6 +195,12 @@ dependencies {
implementation 'androidx.work:work-runtime-ktx:2.8.1'
implementation 'androidx.concurrent:concurrent-futures-ktx:1.1.0'
//Database
implementation("androidx.room:room-runtime:2.6.0")
annotationProcessor("androidx.room:room-compiler:2.6.0")
kapt("androidx.room:room-compiler:2.6.0")
implementation("androidx.room:room-ktx:2.6.0")
//Payment
implementation 'com.stripe:stripe-android:20.28.3'

View file

@ -1,5 +1,8 @@
package com.futo.platformplayer.stores.db
class ManagedDBIndex {
import androidx.room.PrimaryKey
}
open class ManagedDBIndex(
@PrimaryKey(true)
val id: Int? = null
)

View file

@ -1,5 +1,41 @@
package com.futo.platformplayer.stores.db
class ManagedDBStore {
import com.futo.platformplayer.assume
import com.futo.platformplayer.stores.v2.ManagedStore
import com.futo.platformplayer.stores.v2.ReconstructStore
import com.futo.platformplayer.stores.v2.StoreSerializer
import java.io.File
import kotlin.reflect.KClass
import kotlin.reflect.KType
class ManagedDBStore<I, T> {
private val _class: KType;
private val _name: String;
private val _serializer: StoreSerializer<T>;
private var _isLoaded = false;
private var _withUnique: ((I) -> Any)? = null;
val className: String? get() = _class.classifier?.assume<KClass<*>>()?.simpleName;
val name: String;
constructor(name: String, clazz: KType, serializer: StoreSerializer<T>, niceName: String? = null) {
_name = name;
this.name = niceName ?: name.let {
if(it.isNotEmpty())
return@let it[0].uppercase() + it.substring(1);
return@let name;
};
_serializer = serializer;
_class = clazz;
}
fun load() {
throw NotImplementedError();
_isLoaded = true;
}
}

@ -1 +1 @@
Subproject commit 8f10daba1ef9cbcd99f3c640d86808f8c94aa84a
Subproject commit 37fd342a760be6351b042732a4052bd54d723eb0