package com.gh.gamecenter.gamecollection.choose

import android.app.Application
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.halo.assistant.HaloApp

class ChooseGamesViewModel(application: Application, repository: ChooseGamesRepository) :
    AndroidViewModel(application) {

    val chooseGamesLiveData = repository.chooseGamesLiveData
    val deleteOrAddGameLiveData = repository.deleteOrAddGameLiveData

    class Factory : ViewModelProvider.NewInstanceFactory() {
        override fun <T : ViewModel> create(modelClass: Class<T>): T {
            return ChooseGamesViewModel(
                HaloApp.getInstance().application,
                ChooseGamesRepository.getInstance()
            ) as T
        }
    }
}