package Ġar . com . play 2 play . presentation . tr u co Ċ Ċ import Ġandroid . app . Activity Ċ import Ġandroid . bluetooth . Bluetooth Device Ċ import Ġandroidx . activity . view Models Ċ import Ġcom . google . android . material . bottom sheet . Bottom Sheet Dialog Fragment Ċ import Ġar . com . play 2 play . presentation . base game . Game Activity Ċ import Ġar . com . play 2 play . presentation . tr u co . create . Create Tr u co Fragment Ċ import Ġar . com . play 2 play . presentation . tr u co . final score . Final Score Tr u co Fragment Ċ import Ġar . com . play 2 play . presentation . tr u co . lob by . Tr u co Build Teams Fragment Ċ import Ġar . com . play 2 play . presentation . tr u co . lob by . Tr u co Client Lobby Fragment Ċ import Ġar . com . play 2 play . presentation . tr u co . lob by . Tr u co Server Lobby Fragment Ċ Ċ class ĠTr u co Activity Ġ: ĠGame Activity < Tr u co Specific Game Event , ĠTr u co ViewModel >() Ġ{ ĊĊĠĠĠ Ġoverride Ġval ĠviewModel : ĠTr u co ViewModel Ġby Ġview Models Ġ{ ĊĠĠĠĠĠĠĠ ĠTr u co ViewModel Factory ( this , Ġgame ViewModel Factory Data ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Resume () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Resume () ĊĠĠĠĠĠĠĠ ĠviewModel . on Resume () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Stop () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Stop () ĊĠĠĠĠĠĠĠ ĠviewModel . on Stop () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġgo To Create () Ġ= Ġadd Fragment ( Create Tr u co Fragment . newInstance (), Ġshould AddTo Back Stack Ġ= Ġfalse ) ĊĊĠĠĠ Ġoverride Ġfun Ġgo To Client Lobby () Ġ= ĊĠĠĠĠĠĠĠ Ġadd Fragment ( Tr u co Client Lobby Fragment . newInstance (), Ġshould AddTo Back Stack Ġ= Ġfalse ) ĊĊĠĠĠ Ġoverride Ġfun Ġgo ToServer Lobby () Ġ= ĊĠĠĠĠĠĠĠ Ġadd Fragment ( Tr u co Server Lobby Fragment . newInstance (), Ġshould AddTo Back Stack Ġ= Ġfalse ) ĊĊĠĠĠ Ġprivate Ġfun Ġgo To Build Teams () Ġ= ĊĠĠĠĠĠĠĠ Ġadd Fragment ( Tr u co Build Teams Fragment . newInstance (), Ġshould AddTo Back Stack Ġ= Ġfalse ) ĊĊĠĠĠ Ġoverride Ġfun Ġon Game Event ( event : ĠTr u co Specific Game Event ) Ġ{ ĊĠĠĠĠĠĠĠ Ġwhen Ġ( event ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠTr u co Finish Game Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ// ĠWe Ġdelete Ġthe Ġbottom Ġsheet Ġfragment Ġfrom Ġthe Ġtr u co Ġgame ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ( support FragmentManager . find Fragment By Tag ( Tr u co Fragment . ACTION S _ BOTTOM _ SHE ET _ TAG ) Ġas ĠBottom Sheet Dialog Fragment ?) ?. dismiss () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġadd Fragment ( Final Score Tr u co Fragment . newInstance (), Ġshould AddTo Back Stack Ġ= Ġfalse ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠTr u co Go To Play Ġ-> Ġgo To Play ( event . players Quantity ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠTr u co Go To Build Teams Ġ-> Ġgo To Build Teams () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġelse Ġ-> Ġsuper . on Game Event ( event ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġgo To Play ( players Quantity : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel . stop Loading () ĊĠĠĠĠĠĠĠ Ġwhen Ġ( players Quantity ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠ 2 Ġ-> Ġadd Fragment ( Tr u co Play For 2 Fragment . newInstance (), Ġshould AddTo Back Stack Ġ= Ġfalse ) ĊĠĠĠĠĠĠĠĠĠĠĠĠ 4 Ġ-> Ġadd Fragment ( Tr u co Play For 4 Fragment . newInstance (), Ġshould AddTo Back Stack Ġ= Ġfalse ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĊĠĠĠĠĠĠĠ Ġfun Ġstart Create ( activity : ĠActivity , Ġrequest Code : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstart Create ( Tr u co Activity :: class , Ġactivity , Ġrequest Code ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġfun Ġstart Join ( activity : ĠActivity , Ġrequest Code : ĠInt , Ġserver Device : ĠBluetooth Device ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstart Join ( Tr u co Activity :: class , Ġactivity , Ġrequest Code , Ġserver Device ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// Ġunused . ĊĠĠĠ Ġoverride Ġfun Ġgo To Play () Ġ{ ĊĠĠĠĠĠĠĠ ĠUnit ĊĠĠĠ Ġ} Ċ Ċ } Ċ