22 lines
581 B
Kotlin
22 lines
581 B
Kotlin
package be.kuleuven.howlongtobeat.model
|
|
|
|
import android.content.Context
|
|
import be.kuleuven.howlongtobeat.model.room.GameRepositoryRoomImpl
|
|
|
|
interface GameRepository {
|
|
|
|
companion object {
|
|
/**
|
|
* This makes it easier to switch between implementations if needed and does not expose the RoomImpl
|
|
* Dependency Injection is the better alternative.
|
|
*/
|
|
fun defaultImpl(appContext: Context): GameRepository = GameRepositoryRoomImpl(appContext)
|
|
}
|
|
|
|
fun load(): List<Game>
|
|
|
|
fun save(game: Game)
|
|
|
|
fun overwrite(items: List<Game>)
|
|
}
|