package Ġcom . brain . test . matching . game . ui . game play Ċ Ċ import Ġandroidx . annotation . Drawable Res Ċ import Ġcom . brain . test . matching . game . R Ċ Ċ data Ġclass ĠCard ( ĊĠĠĠ Ġval Ġid : ĠInt , Ġ// Ġunique Ġidentifier Ġused Ġto Ġsearch Ġa Ġparticular Ġcard ĊĠĠĠ Ġ@ Drawable Res Ġval Ġimage : ĠInt , Ġ// Ġthe Ġimage Ġof Ġthe Ġcard ĊĠĠĠ Ġval Ġstate : ĠCard State Ġ= ĠCard State . Clickable . Image Hidden Ġ// Ġall Ġcards Ġare Ġhidden Ġinitially Ċ ) Ċ Ċ sealed Ġclass ĠCard State Ġ{ ĊĠĠĠ Ġobject ĠUn Clickable Ġ: ĠCard State () Ġ// Ġstate Ġwhen Ġthe Ġcards Ġare Ġmatched ( a . k . a . success Ġstate ) ĊĠĠĠ Ġsealed Ġclass ĠClick able Ġ: ĠCard State () Ġ{ ĊĠĠĠĠĠĠĠ Ġobject ĠImage Shown Ġ: ĠClick able () Ġ// Ġclick able Ġand Ġimage Ġshown ĊĠĠĠĠĠĠĠ Ġobject ĠImage Hidden Ġ: ĠClick able () Ġ// Ġclick able Ġbut Ġimage Ġhidden ĊĠĠĠ Ġ} Ċ } Ċ Ċ /** Ċ Ġ* ĠCreates Ġa Ġlist Ġof Ġ 8 Ġpairs ( 1 6 Ġitems ) Ġwith Ġsame Ġ[ Card . image ] Ċ Ġ*/ Ċ val Ġcards List Ġ= ĠlistOf ( ĊĠĠĠ ĠCard ( 1 , ĠR . drawable . drawable _ animal _ nez umi ), ĊĠĠĠ ĠCard ( 9 , ĠR . drawable . drawable _ animal _ nez umi ), ĊĊĠĠĠ ĠCard ( 2 , ĠR . drawable . drawable _ animal _ t ora ), ĊĠĠĠ ĠCard ( 1 0 , ĠR . drawable . drawable _ animal _ t ora ), ĊĊĠĠĠ ĠCard ( 3 , ĠR . drawable . drawable _ animal _ t ats u ), ĊĠĠĠ ĠCard ( 1 1 , ĠR . drawable . drawable _ animal _ t ats u ), ĊĊĠĠĠ ĠCard ( 4 , ĠR . drawable . drawable _ animal _ he bi ), ĊĠĠĠ ĠCard ( 1 2 , ĠR . drawable . drawable _ animal _ he bi ), ĊĊĠĠĠ ĠCard ( 5 , ĠR . drawable . drawable _ animal _ hits u ji ), ĊĠĠĠ ĠCard ( 1 3 , ĠR . drawable . drawable _ animal _ hits u ji ), ĊĊĠĠĠ ĠCard ( 6 , ĠR . drawable . drawable _ animal _ sar u ), ĊĠĠĠ ĠCard ( 1 4 , ĠR . drawable . drawable _ animal _ sar u ), ĊĊĠĠĠ ĠCard ( 7 , ĠR . drawable . drawable _ animal _ inu ), ĊĠĠĠ ĠCard ( 1 5 , ĠR . drawable . drawable _ animal _ inu ), ĊĊĠĠĠ ĠCard ( 8 , ĠR . drawable . drawable _ animal _ in osh ish i ), ĊĠĠĠ ĠCard ( 1 6 , ĠR . drawable . drawable _ animal _ in osh ish i ), Ċ )