/* Ċ Ġ* ĠCopyright Ġ 2 0 2 0 ĠPaul ĠR y bits ky i , Ġpa ul . ry bits ky i . work @ gmail . com Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġcom . paul ry bits ky i . game d ge . feature . info . mapping Ċ Ċ import Ġcom . paul ry bits ky i . game d ge . core . Game Like Count Calculator Ċ import Ġcom . paul ry bits ky i . game d ge . core . factories . I gdb Image Size Ċ import Ġcom . paul ry bits ky i . game d ge . core . factories . I gdb ImageUrl Factory Ċ import Ġcom . paul ry bits ky i . game d ge . core . factories . create Urls Ċ import Ġcom . paul ry bits ky i . game d ge . core . format ters . Game Age Rating Formatter Ċ import Ġcom . paul ry bits ky i . game d ge . core . format ters . Game Category Formatter Ċ import Ġcom . paul ry bits ky i . game d ge . core . format ters . Game Rating Formatter Ċ import Ġcom . paul ry bits ky i . game d ge . core . format ters . Game Release Date Formatter Ċ import Ġcom . paul ry bits ky i . game d ge . domain . games . entities . Game Ċ import Ġcom . paul ry bits ky i . game d ge . feature . info . widgets . main . header . Game Header Image Model Ċ import Ġcom . paul ry bits ky i . game d ge . feature . info . widgets . main . model . Game Info Header Model Ċ import Ġcom . paul ry bits ky i . h ilt binder . Bind Type Ċ import Ġjavax . inject . Inject Ċ Ċ internal Ġinterface ĠGame Info Header Model Factory Ġ{ ĊĠĠĠ Ġfun Ġcreate Header Model ( game : ĠGame , Ġis Lik ed : ĠBoolean ): ĠGame Info Header Model Ċ } Ċ Ċ @ Bind Type ( install In Ġ= ĠBind Type . Component . VIEW _ MODEL ) Ċ internal Ġclass ĠGame Info Header Model Factory Impl Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġig db ImageUrl Factory : ĠI gdb ImageUrl Factory , ĊĠĠĠ Ġprivate Ġval Ġrelease Date Formatter : ĠGame Release Date Formatter , ĊĠĠĠ Ġprivate Ġval Ġrating Formatter : ĠGame Rating Formatter , ĊĠĠĠ Ġprivate Ġval Ġlike Count Calculator : ĠGame Like Count Calculator , ĊĠĠĠ Ġprivate Ġval Ġage Rating Formatter : ĠGame Age Rating Formatter , ĊĠĠĠ Ġprivate Ġval Ġcategory Formatter : ĠGame Category Formatter Ċ ) Ġ: ĠGame Info Header Model Factory Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġcreate Header Model ( game : ĠGame , Ġis Lik ed : ĠBoolean ): ĠGame Info Header Model Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠGame Info Header Model ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbackground Image Models Ġ= Ġgame . create Background Image Models (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis Lik ed Ġ= Ġis Lik ed , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcover ImageUrl Ġ= Ġgame . create Cover ImageUrl (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtitle Ġ= Ġgame . name , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrelease Date Ġ= Ġgame . format Release Date (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdeveloper Name Ġ= Ġgame . developer Company ?. name , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrating Ġ= Ġgame . format Rating (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlike Count Ġ= Ġgame . calculate Like Count (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġage Rating Ġ= Ġgame . format Age Rating (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġgame Category Ġ= Ġgame . format Category () ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠGame . create Background Image Models (): ĠList < Game Header Image Model > Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( art works . isEmpty ()) Ġreturn ĠlistOf ( Game Header Image Model . Default Image ) ĊĊĠĠĠĠĠĠĠ Ġreturn Ġig db ImageUrl Factory ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. create Urls ( art works , ĠI gdb ImageUrl Factory . Config ( I gdb Image Size . BIG _ SCREEN SHOT )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. map ( Game Header Image Model :: Url Image ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠGame . create Cover ImageUrl (): ĠString ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġcover ?. let Ġ{ Ġcover Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġig db ImageUrl Factory . create Url ( cover , ĠI gdb ImageUrl Factory . Config ( I gdb Image Size . BIG _ COVER )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠGame . format Release Date (): ĠString Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġrelease Date Formatter . format Release Date ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠGame . format Rating (): ĠString Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġrating Formatter . format Rating ( total Rating ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠGame . calculate Like Count (): ĠString Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġlike Count Calculator . calculate Like Count ( this ). toString () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠGame . format Category (): ĠString Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġcategory Formatter . format Category ( category ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠGame . format Age Rating (): ĠString Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġage Rating Formatter . format Age Rating ( this ) ĊĠĠĠ Ġ} Ċ } Ċ