package Ġcom . ca uch ym op . gob lob . analytics Ċ Ċ import Ġandroidx . annotation . NonNull Ċ import Ġcom . ca uch ym op . gob lob . logger . Event Logger Ċ import Ġcom . ca uch ym op . gob lob . model . Analytics Ċ import Ġcom . ca uch ym op . gob lob . proto . Play Game Data Ċ import Ġcom . ca uch ym op . gob lob . proto . Play Game Data .* Ċ import Ġcom . ca uch ym op . gob lob . proto . Play Game Data . Game Data . Phase Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠFirebase Analytics Sender Ġ@ Inject Ċ constructor ( private Ġval Ġevent Logger : ĠEvent Logger ) Ġ: ĠAnalytics Ġ{ ĊĊĠ Ġoverride Ġfun Ġgame Created ( game : ĠGame Data ) Ġ{ ĊĠĠĠ Ġval Ġbundle Ġ= Ġget Game Configuration Bundle ( game . game Configuration ) ĊĠĠĠ Ġevent Logger . log Event (" game Created ", Ġbundle ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġconfiguration Changed ( game : ĠPlay Game Data . Game Data ) Ġ{ ĊĠĠĠ Ġval Ġgame Type Ġ= Ġgame . game Configuration . game Type ĊĠĠĠ Ġif Ġ( game Type Ġ== ĠPlay Game Data . Game Type . REMOTE ) Ġ{ ĊĠĠĠĠĠ Ġevent Logger . log Event (" configuration Changed ", Ġget Game Configuration Bundle ( game . game Configuration ). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġput (" ag reed ", Ġ"${ game . phase Ġ== ĠPhase . IN _ GAME }") ĊĠĠĠĠĠ Ġ}) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġundo () Ġ{ ĊĠĠĠ Ġevent Logger . log Event (" undo ") ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġredo () Ġ{ ĊĠĠĠ Ġevent Logger . log Event (" redo ") ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġres ign () Ġ{ ĊĠĠĠ Ġevent Logger . log Event (" res ign ") ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġmove Play ed ( game Configuration : ĠGame Configuration , Ġmove : ĠPlay Game Data . Move ) Ġ{ ĊĠĠĠ Ġif Ġ( move . type Ġ== ĠPlay Game Data . Move . Move Type . PASS ) Ġ{ ĊĠĠĠĠĠ Ġevent Logger . log Event (" passed ", Ġget Game Configuration Bundle ( game Configuration )) ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠ Ġevent Logger . log Event (" move Play ed ", Ġget Game Configuration Bundle ( game Configuration )) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġdead Stone Toggle d ( game Configuration : ĠGame Configuration ) Ġ{ ĊĠĠĠ Ġevent Logger . log Event (" dead Stone Toggle d ", Ġget Game Configuration Bundle ( game Configuration )) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġinvalid Move Play ed ( game Configuration : ĠGame Configuration ) Ġ{ ĊĠĠĠ Ġevent Logger . log Event (" invalid Move Play ed ", Ġget Game Configuration Bundle ( game Configuration )) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġgame Finished ( game Configuration : ĠGame Configuration , Ġscore : ĠScore ) Ġ{ ĊĠĠĠ Ġevent Logger . log Event (" game Finished ", Ġget Game Configuration Bundle ( game Configuration ). apply Ġ{ ĊĠĠĠĠĠ Ġput (" res ign ed ", Ġ"${ score . res ign ed }") ĊĠĠĠĠĠ Ġput (" won By ", Ġ"${ score . won By }") ĊĠĠĠĠĠ Ġput (" winner ", Ġ"${ score . winner }") ĊĠĠĠ Ġ}) ĊĠ Ġ} ĊĊĠ Ġ@ NonNull ĊĠ Ġprivate Ġfun Ġget Game Configuration Bundle ( game Configuration : ĠGame Configuration ): ĠMutable Map < String , ĠString > Ġ= ĊĠĠĠĠĠ Ġmutable Map Of (" type " Ġto Ġgame Configuration . game Type . name , ĊĠĠĠĠĠĠĠĠĠ Ġ" size " Ġto Ġgame Configuration . board Size . toString (), ĊĠĠĠĠĠĠĠĠĠ Ġ" hand ic ap " Ġto Ġgame Configuration . hand ic ap . toString ()) Ċ Ċ } Ċ