package Ġcom . ach aw ki . sequence trainer . view model Ċ Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġandroidx . lifecycle . viewModel Scope Ċ import Ġcom . ach aw ki . sequence trainer . data . Sequence Ċ import Ġcom . ach aw ki . sequence trainer . data . Sequence Repository Ċ import Ġcom . ach aw ki . sequence trainer . data . Statistic Ċ import Ġdagger . h ilt . android . lifecycle . H ilt ViewModel Ċ import Ġkotlinx . coroutines . launch Ċ import Ġjavax . inject . Inject Ċ Ċ @ H ilt ViewModel Ċ class ĠSequence Trainer ViewModel Ġ@ Inject Ġconstructor ( private Ġval Ġsequence Repository : ĠSequence Repository ) Ġ: ĊĠĠĠ ĠViewModel () Ġ{ ĊĊĠĠĠ Ġfun Ġinsert Sequence ( sequence : ĠSequence ) Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsequence . id Ġ= Ġsequence Repository . insert Sequence ( sequence ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġupdate Sequence ( updated Sequence : ĠSequence ) Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsequence Repository . update Sequence ( updated Sequence ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġget Active Sequence ( difficulty : ĠInt ): ĠSequence ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġsequence Repository . getActive Sequence ( difficulty ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġget Statistics (): ĠList < Statistic > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġsequence Repository . get Statistics () ĊĠĠĠ Ġ} Ċ }