/* Ċ Ġ* ĠCopyright Ġ( c ) Ġ 2 0 2 1 - 2 0 2 1 , Ċ Ġ* ĠThis Ġlibrary Ġclass Ġwas Ġcreated Ġby Ġ 0 xFC 9 6 3 F 1 8 DC 2 1 Ġ/ ĠSh ots 2 4 3 Ċ Ġ* ĠIt Ġis Ġpart Ġof Ġan Ġextension Ġlibrary Ġfor Ġthe Ġgame ĠNull po Min o Ġ( copyright Ġ 2 0 2 1 - 2 0 2 1 ) Ċ Ġ* Ċ Ġ* ĠKotlin Ġconverted Ġand Ġmodified Ġby ĠV en om = N hel v Ċ Ġ* Ċ Ġ* ĠHer ew ith Ġshall Ġthe Ġterm Ġ" Library ĠCreator " Ġbe Ġgiven Ġto Ġ 0 xFC 9 6 3 F 1 8 DC 2 1 . Ċ Ġ* ĠHer ew ith Ġshall Ġthe Ġterm Ġ" Game ĠCreator " Ġbe Ġgiven Ġto Ġthe Ġoriginal Ġcreator Ġof ĠNull po Min o , ĠNull Non ame . Ċ Ġ* Ċ Ġ* ĠTHIS ĠLIB R ARY ĠAND ĠMODE ĠPACK ĠW AS ĠNOT ĠMA DE ĠIN ĠASS OCI ATION ĠWITH ĠTHE ĠGAME ĠCRE ATOR . Ċ Ġ* Ċ Ġ* ĠRepository : Ġhttps :// github . com / Sh ots 2 4 3 / Mode P ile Ċ Ġ* Ċ Ġ* ĠWhen Ġusing Ġthis Ġlibrary Ġin Ġa Ġmode Ġ/ Ġlibrary Ġpack Ġof Ġyour Ġown , Ġthe Ġfollowing Ċ Ġ* Ġconditions Ġmust Ġbe Ġsatisfied : Ċ Ġ* ĠĠĠĠ Ġ- ĠThis Ġlicense Ġmust Ġremain Ġvisible Ġat Ġthe Ġtop Ġof Ġthe Ġdocument , Ġun modified . Ċ Ġ* ĠĠĠĠ Ġ- ĠYou Ġare Ġallowed Ġto Ġuse Ġthis Ġlibrary Ġfor Ġany Ġmod ding Ġpurpose . Ċ Ġ* ĠĠĠĠĠĠĠĠ Ġ- ĠIf Ġthis Ġis Ġthe Ġcase , Ġthe ĠLibrary ĠCreator Ġmust Ġbe Ġcredit ed Ġsomewhere . Ċ Ġ* ĠĠĠĠĠĠĠĠĠĠĠĠ Ġ- ĠSource Ġcomments Ġonly Ġare Ġfine , Ġbut Ġin Ġa ĠREADME Ġis Ġrecommended . Ċ Ġ* ĠĠĠĠ Ġ- ĠMod ification Ġof Ġthis Ġlibrary Ġis Ġallowed , Ġbut Ġonly Ġin Ġthe Ġcondition Ġthat Ġa Ċ Ġ* ĠĠĠĠĠĠ Ġpull Ġrequest Ġis Ġmade Ġto Ġmerge Ġthe Ġchanges Ġto Ġthe Ġrepository . Ċ Ġ* Ċ Ġ* ĠTHIS ĠSOFTWARE ĠIS ĠPROVIDED ĠBY ĠTHE ĠCOPYRIGHT ĠHOLDERS ĠAND ĠCONTRIBUTORS Ġ" AS ĠIS " Ċ Ġ* ĠAND ĠANY ĠEXPRESS ĠOR ĠIMPLIED ĠWARRANTIES , ĠINCLUDING , ĠBUT ĠNOT ĠLIMITED ĠTO , ĠTHE Ċ Ġ* ĠIMPLIED ĠWARRANTIES ĠOF ĠMERCHANTABILITY ĠAND ĠFITNESS ĠFOR ĠA ĠPARTICULAR ĠPURPOSE Ċ Ġ* ĠARE ĠDISCLAIMED . ĠIN ĠNO ĠEVENT ĠSHALL ĠTHE ĠCOPYRIGHT ĠOWNER ĠOR ĠCONTRIBUTORS ĠBE Ċ Ġ* ĠLIABLE ĠFOR ĠANY ĠDIRECT , ĠINDIRECT , ĠINCIDENTAL , ĠSPECIAL , ĠEXEMPLARY , ĠOR Ċ Ġ* ĠCONSEQUENTIAL ĠDAMAGES Ġ( INCLUDING , ĠBUT ĠNOT ĠLIMITED ĠTO , ĠPROCUREMENT ĠOF Ċ Ġ* ĠSUBSTITUTE ĠGOODS ĠOR ĠSERVICES ; ĠLOSS ĠOF ĠUSE , ĠDATA , ĠOR ĠPROFITS ; ĠOR ĠBUSINESS Ċ Ġ* ĠINTERRUPTION ) ĠHOWEVER ĠCAUSED ĠAND ĠON ĠANY ĠTHEORY ĠOF ĠLIABILITY , ĠWHETHER ĠIN Ċ Ġ* ĠCONTRACT , ĠSTRICT ĠLIABILITY , ĠOR ĠTORT Ġ( INCLUDING ĠNEGLIGENCE ĠOR ĠOTHERWISE ) Ċ Ġ* ĠARISING ĠIN ĠANY ĠWAY ĠOUT ĠOF ĠTHE ĠUSE ĠOF ĠTHIS ĠSOFTWARE , ĠEVEN ĠIF ĠADVISED ĠOF ĠTHE Ċ Ġ* ĠPOSSIBILITY ĠOF ĠSUCH ĠDAMAGE . Ċ Ġ*/ Ċ Ċ package Ġz er ox fc . null po . custom . modes Ċ Ċ import Ġmu . nu . null po . game . component . B GM Status Ċ import Ġmu . nu . null po . game . component . Block Ċ import Ġmu . nu . null po . game . component . Controller Ċ import Ġmu . nu . null po . game . component . Field Ċ import Ġmu . nu . null po . game . event . Event Receiver . COLOR Ċ import Ġmu . nu . null po . game . play . Game Engine Ċ import Ġmu . nu . null po . game . subsystem . mode . Abstract Mode Ċ import Ġmu . nu . null po . util . Custom Properties Ċ import Ġmu . nu . null po . util . General Util . to Time Str Ċ import Ġz er ox fc . null po . custom . libs . Profile Properties Ċ import Ġz er ox fc . null po . custom . modes . objects . min es w eeper . Game Grid Ċ import Ġkotlin . math . min Ċ import Ġkotlin . random . Random Ċ Ċ class ĠM ines w eeper : Abstract Mode () Ġ{ Ċ ĉ private Ġvar Ġmain Grid : Game Grid Ġ= ĠGame Grid () Ċ ĉ private Ġvar Ġlength Ġ= Ġ 0 Ċ ĉ private Ġvar Ġheight Ġ= Ġ 0 Ċ ĉ private Ġvar Ġcursor X Ġ= Ġ 0 Ċ ĉ private Ġvar Ġcursor Y Ġ= Ġ 0 Ċ ĉ private Ġvar Ġcursor Screen X Ġ= Ġ 0 Ċ ĉ private Ġvar Ġcursor Screen Y Ġ= Ġ 0 Ċ ĉ private Ġvar Ġoffset X Ġ= Ġ 0 Ċ ĉ private Ġvar Ġoffset Y Ġ= Ġ 0 Ċ ĉ private Ġvar Ġblock Grid : Array < Array < Block ? >> Ġ= Ġempty Array () Ċ ĉ private Ġvar Ġmine Percentage Ġ= Ġ 0 f Ċ ĉ private Ġvar Ġfirst Click Ġ= Ġfalse Ċ ĉ private Ġvar Ġlocal Rand : Random ? Ġ= Ġnull Ċ ĉ private Ġvar Ġbg m Ġ= Ġ 0 Ċ ĉ private Ġvar Ġbg Ġ= Ġ 0 Ċ ĉ private Ġvar Ġtime Limit Ġ= Ġ 0 Ċ ĉ private Ġvar Ġcurrent Limit Ġ= Ġ 0 Ċ ĉ private Ġvar ĠnumberOf Cover Ġ= Ġ 0 Ċ ĉ override Ġval Ġname : String Ġget () Ġ= Ġ" Mine Sw eeper " ĊĊ ĉ override Ġfun Ġplayer Init ( engine : Game Engine , Ġplayer ID : Int ) Ġ{ Ċĉ ĉ // Sound Loader . load Sound set ( Sound Loader . LOAD TYPE _ MIN ES W EE PER ) Ċĉ ĉ owner Ġ= Ġengine . owner Ċĉ ĉ length Ġ= Ġ 0 Ċĉ ĉ height Ġ= Ġ 0 Ċĉ ĉ cursor X Ġ= Ġ 0 Ċĉ ĉ cursor Y Ġ= Ġ 0 Ċĉ ĉ offset X Ġ= Ġ 0 Ċĉ ĉ offset Y Ġ= Ġ 0 Ċĉ ĉ cursor Screen X Ġ= Ġ 0 Ċĉ ĉ cursor Screen Y Ġ= Ġ 0 Ċĉ ĉ first Click Ġ= Ġtrue Ċĉ ĉ mine Percentage Ġ= Ġ 0 f Ċĉ ĉ bg m Ġ= Ġ 0 Ċĉ ĉ bg Ġ= Ġ 0 Ċĉ ĉ time Limit Ġ= Ġ 0 Ċĉ ĉ current Limit Ġ= Ġ 0 Ċĉ ĉ numberOf Cover Ġ= Ġ 0 Ċĉ ĉ engine . frame color Ġ= ĠGame Engine . FRAME _ COLOR _ BLUE Ċĉ ĉ engine . block Outline Type Ġ= ĠGame Engine . BLOCK _ OUT LINE _ SAME COLOR Ċĉ ĉ main Grid Ġ= ĠGame Grid () Ċĉ ĉ block Grid Ġ= Ġempty Array () Ċĉ ĉ if (! owner . replay Mode ) Ġload Setting ( owner . mode Config ) Ċĉ ĉ else Ġload Setting ( owner . replay Prop ) ĊĊĉ ĉ engine . owner . background Status . bg Ġ= Ġbg Ċ ĉ } ĊĊ ĉ override Ġfun Ġon Setting ( engine : Game Engine , Ġplayer ID : Int ): Boolean Ġ{ Ċĉ ĉ main Grid Ġ= ĠGame Grid () ĊĊĉ ĉ // ĠMenu Ċĉ ĉ if (! engine . owner . replay Mode ) Ġ{ Ċĉĉ ĉ // ĠConfiguration Ġchanges Ċĉĉ ĉ val Ġchange : Int Ġ= Ġupdate Cursor ( engine , Ġ 5 , Ġplayer ID ) Ċĉĉ ĉ if ( change != 0 ) Ġ{ Ċĉĉĉ ĉ engine . play SE (" change ") Ċĉĉĉ ĉ when ( engine . stat c [ 2 ]) Ġ{ Ċĉĉĉĉĉ 0 Ġ-> Ġ{ Ċĉĉĉĉĉ ĉ length Ġ+= Ġchange Ċĉĉĉĉĉ ĉ if ( length > 2 5 6 ) Ġlength Ġ= Ġ 4 Ċĉĉĉĉĉ ĉ if ( length < 4 ) Ġlength Ġ= Ġ 2 5 6 Ċĉĉĉĉ ĉ } Ċĉĉĉĉĉ 1 Ġ-> Ġ{ Ċĉĉĉĉĉ ĉ height Ġ+= Ġchange Ċĉĉĉĉĉ ĉ if ( height > 2 5 6 ) Ġheight Ġ= Ġ 5 Ċĉĉĉĉĉ ĉ if ( height < 4 ) Ġheight Ġ= Ġ 2 5 6 Ċĉĉĉĉ ĉ } Ċĉĉĉĉĉ 2 Ġ-> Ġ{ Ċĉĉĉĉĉ ĉ mine Percentage Ġ+= Ġchange * 0 . 1 f Ċĉĉĉĉĉ ĉ if ( mine Percentage > 9 9 . 9 f ) Ġmine Percentage Ġ= Ġ 0 . 1 f Ċĉĉĉĉĉ ĉ if ( mine Percentage < 0 . 1 f ||( length * height *( mine Percentage / 1 0 0 f )). toInt ()== 0 ) Ġmine Percentage Ġ= Ġ 9 9 . 9 f Ċĉĉĉĉ ĉ } Ċĉĉĉĉĉ 3 Ġ-> Ġ{ Ċĉĉĉĉĉ ĉ time Limit Ġ+= Ġ 6 0 * change Ċĉĉĉĉĉ ĉ if ( time Limit > 3 6 0 0 0 ) Ġtime Limit Ġ= Ġ 0 Ċĉĉĉĉĉ ĉ if ( time Limit < 0 ) Ġtime Limit Ġ= Ġ 3 6 0 0 0 Ċĉĉĉĉ ĉ } Ċĉĉĉĉĉ 4 Ġ-> Ġ{ Ċĉĉĉĉĉ ĉ bg m Ġ+= Ġchange Ċĉĉĉĉĉ ĉ if ( bg m > 1 5 ) Ġbg m Ġ= Ġ 0 Ċĉĉĉĉĉ ĉ if ( bg m < 0 ) Ġbg m Ġ= Ġ 1 5 Ċĉĉĉĉ ĉ } Ċĉĉĉĉĉ 5 Ġ-> Ġ{ Ċĉĉĉĉĉ ĉ bg Ġ+= Ġchange Ċĉĉĉĉĉ ĉ if ( bg > 1 9 ) Ġbg Ġ= Ġ 0 Ċĉĉĉĉĉ ĉ if ( bg < 0 ) Ġbg Ġ= Ġ 1 9 Ċĉĉĉĉĉ ĉ engine . owner . background Status . bg Ġ= Ġbg Ċĉĉĉĉ ĉ } Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ċĉĉ ĉ engine . owner . background Status . bg Ġ= Ġbg ĊĊĉĉ ĉ // ĠConfirm Ċĉĉ ĉ if ( engine . ctrl . is Push ( Controller . BUTTON _ A ) && engine . stat c [ 3 ] >= 5 ) Ġ{ Ċĉĉĉ ĉ engine . play SE (" dec ide ") Ċĉĉĉ ĉ if ( engine . player Prop . is LoggedIn ) Ġ{ Ċĉĉĉĉ ĉ save Setting Player ( engine . player Prop ) Ċĉĉĉĉ ĉ engine . player Prop . save Profile Config () Ċĉĉĉ ĉ } Ġelse Ġ{ Ċĉĉĉĉ ĉ save Setting ( owner . mode Config ) Ċĉĉĉĉ ĉ owner . save Mode Config () Ċĉĉĉ ĉ } Ċĉĉĉ ĉ return Ġfalse Ċĉĉ ĉ } ĊĊĉĉ ĉ // ĠCancel Ċĉĉ ĉ if ( engine . ctrl . is Push ( Controller . BUTTON _ B )) Ġ{ Ċĉĉĉ ĉ engine . quit flag Ġ= Ġtrue Ċĉĉ ĉ } ĊĊĉĉ ĉ // ĠNew Ġacc Ċĉĉ ĉ if ( engine . ctrl . is Push ( Controller . BUTTON _ E ) && engine . ai == null ) Ġ{ Ċĉĉĉ ĉ engine . play SE (" dec ide ") Ċĉĉĉ ĉ engine . stat Ġ= ĠGame Engine . Status . CUSTOM Ċĉĉĉ ĉ engine . reset Stat c () Ċĉĉĉ ĉ return Ġtrue Ċĉĉ ĉ } Ċĉĉ ĉ engine . stat c [ 3 ] ++ Ċĉ ĉ } Ġelse Ġ{ Ċĉĉ ĉ engine . stat c [ 3 ] ++ Ċĉĉ ĉ engine . stat c [ 2 ] Ġ= Ġ- 1 Ċĉĉ ĉ return Ġengine . stat c [ 3 ]< 6 0 Ċĉ ĉ } Ċĉ ĉ return Ġtrue Ċ ĉ } ĊĊ ĉ override Ġfun Ġrender Setting ( engine : Game Engine , Ġplayer ID : Int ) Ġ{ Ċĉ ĉ draw Menu ( engine , Ġplayer ID , Ġreceiver , Ġ 0 , ĠCOLOR . BLUE , Ġ 0 , Ġ" WIDTH " Ġto Ġlength , Ġ" HEIGHT " Ġto Ġheight ) Ċĉ ĉ draw Menu ( engine , Ġplayer ID , Ġreceiver , Ġ 4 , ĠCOLOR . RED , Ġ 2 , Ċĉĉ ĉ " M INE %" Ġto ĠString . format ("% . 2 f ", Ġmine Percentage ), Ċĉĉ ĉ " TIME ĠLIMIT " Ġto Ġif ( time Limit > 0 ) Ġtime Limit . to Time Str Ġelse Ġ" DISABLED ") Ċĉ ĉ draw Menu B GM ( engine , Ġplayer ID , Ġreceiver , Ġbg m , ĠCOLOR . GREEN ) Ċĉ ĉ draw Menu ( engine , Ġplayer ID , Ġreceiver , Ġ 1 0 , ĠCOLOR . GREEN , Ġ 5 , Ġ" BACKGROUND " Ġto Ġbg ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġon Last ( engine : Game Engine , Ġplayer ID : Int ) Ġ{ Ċĉ ĉ if ( engine . quit flag ) Ġ{ Ċĉĉ ĉ engine . player Prop . reset () Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ override Ġfun Ġon Ready ( engine : Game Engine , Ġplayer ID : Int ): Boolean Ġ{ Ċĉ ĉ // Ġæ¨ ª æº ľ ãĤģ Ċĉ ĉ if ( engine . rule Opt . das In Ready && engine . game Active ) Ġengine . pad Repeat () Ġelse Ġif ( engine . rule Opt . das Redirect In Delay ) Ġ{ Ċĉĉ ĉ engine . das Redirect () Ċĉ ĉ } ĊĊĉ ĉ // ĠInitialization Ċĉ ĉ if ( engine . stat c [ 0 ]== 0 ) Ġ{ Ċĉĉ ĉ // Ġfield Initialization Ċĉĉ ĉ block Grid Ġ= ĠArray ( height ) Ġ{ array Of Null s ( length )} Ċĉĉ ĉ for ( y Ġin Ġblock Grid . indices ) Ġ{ Ċĉĉĉ ĉ for ( x Ġin Ġ 0 Ġuntil Ġblock Grid [ y ]. size ) Ġ{ Ċĉĉĉĉ ĉ block Grid [ y ][ x ] Ġ= ĠBlock () Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ċĉĉ ĉ cursor X Ġ= Ġ 0 Ċĉĉ ĉ cursor Y Ġ= Ġ 0 Ċĉĉ ĉ offset X Ġ= Ġ 0 Ċĉĉ ĉ offset Y Ġ= Ġ 0 Ċĉĉ ĉ cursor Screen X Ġ= Ġ 0 Ċĉĉ ĉ cursor Screen Y Ġ= Ġ 0 Ċĉĉ ĉ current Limit Ġ= Ġtime Limit Ċĉĉ ĉ first Click Ġ= Ġtrue Ċĉĉ ĉ local Rand Ġ= ĠRandom ( engine . rand Seed ) Ċĉĉ ĉ main Grid Ġ= ĠGame Grid ( length , Ġheight , Ġmine Percentage , Ġengine . rand Seed ) Ċĉĉ ĉ engine . rule Opt . field Width Ġ= Ġmin ( length , ĠMAX _ DIM ) Ċĉĉ ĉ engine . rule Opt . field Height Ġ= Ġmin ( height , ĠMAX _ DIM ) Ċĉĉ ĉ engine . rule Opt . field Hidden Height Ġ= Ġ 0 Ċĉĉ ĉ engine . field Width Ġ= Ġengine . rule Opt . field Width Ċĉĉ ĉ engine . field Height Ġ= Ġengine . rule Opt . field Height Ċĉĉ ĉ engine . field Hidden Height Ġ= Ġengine . rule Opt . field Hidden Height Ċĉĉ ĉ engine . field Ġ= ĠField ( engine . field Width , Ġengine . field Height , Ġengine . field Hidden Height , Ġengine . rule Opt . field Ce iling ) Ċĉĉ ĉ if (! engine . ready Done ) Ġ{ Ċĉĉĉ ĉ // Ġ Ġbutton Ġinput çĬ¶æħĭ ãĥª ãĤ»ãĥĥãĥĪ Ċĉĉĉ ĉ engine . ctrl . reset () Ċĉĉĉ ĉ // ĠãĤ ² ãĥ¼ãĥł ä¸Ń Ġflag ON Ċĉĉĉ ĉ engine . game Active Ġ= Ġtrue Ċĉĉĉ ĉ engine . game Started Ġ= Ġtrue Ċĉĉĉ ĉ engine . isIn Game Ġ= Ġtrue Ċĉĉ ĉ } Ċĉ ĉ } ĊĊĉ ĉ // ĠREAD Y éŁ³ Ċĉ ĉ if ( engine . stat c [ 0 ]== engine . ready Start ) Ġengine . play SE (" ready ") ĊĊĉ ĉ // ĠGO éŁ³ Ċĉ ĉ if ( engine . stat c [ 0 ]== engine . go Start ) Ġengine . play SE (" go ") ĊĊĉ ĉ // Ġ éĸĭå§ĭ Ċĉ ĉ if ( engine . stat c [ 0 ] >= engine . go End ) Ġ{ Ċĉĉ ĉ if (! engine . ready Done ) Ġengine . owner . bg m Status . bg m Ġ= ĠBG M Status . B GM . values [ bg m ] Ċĉĉ ĉ engine . owner . mode ?. start Game ( engine , Ġplayer ID ) Ċĉĉ ĉ engine . owner . receiver . start Game ( engine , Ġplayer ID ) Ċĉĉ ĉ engine . stat Ġ= ĠGame Engine . Status . CUSTOM Ċĉĉ ĉ engine . reset Stat c () Ċĉĉ ĉ if (! engine . ready Done ) Ġ{ Ċĉĉĉ ĉ engine . startTime Ġ= ĠSystem . nano Time () Ċĉĉĉ ĉ // startTime Ġ= ĠSystem . nano Time ()/ 1 0 0 0 0 0 0 L ; Ċĉĉ ĉ } Ċĉĉ ĉ engine . ready Done Ġ= Ġtrue Ċĉĉ ĉ return Ġtrue Ċĉ ĉ } Ċĉ ĉ engine . stat c [ 0 ] ++ Ċĉ ĉ return Ġtrue Ċ ĉ } ĊĊ ĉ override Ġfun Ġon Game Over ( engine : Game Engine , Ġplayer ID : Int ): Boolean Ġ{ Ċĉ ĉ val Ġfield Ġ= Ġengine . field Ċĉ ĉ if ( engine . li ves <= 0 ) Ċĉĉ ĉ when Ġ{ Ċĉĉĉ ĉ engine . stat c [ 0 ]== 0 Ġ-> Ġ{ Ċĉĉĉĉ ĉ // ĠãĤ Ĥ ãģĨ å¾ © æ´» ãģ§ãģį ãģªãģĦ ãģ¨ ãģį Ċĉĉĉĉ ĉ engine . game Ended () Ċĉĉĉĉ ĉ engine . block Show Outline Only Ġ= Ġfalse Ċĉĉĉĉ ĉ if ( owner . players < 2 ) Ġowner . bg m Status . bg m Ġ= ĠBG M Status . B GM . Sil ent Ċĉĉĉĉ ĉ if ( field . isEmpty ) Ġengine . stat c [ 0 ] Ġ= Ġfield . height + 1 Ġelse Ġengine . reset Field Visible () Ċĉĉĉ ĉ } Ċĉĉĉ ĉ engine . stat c [ 0 ]< field . height + 1 Ġ-> Ġ{ Ċĉĉĉĉ ĉ for ( i Ġin Ġ 0 Ġuntil Ġfield . width ) Ċĉĉĉĉĉ ĉ field . getBlock ( i , Ġfield . height - engine . stat c [ 0 ]) ?. let Ġ{ blk Ġ-> Ċĉĉĉĉĉĉ ĉ val Ġcovered Ġ= ĠBlock ( Block . COLOR . BLUE , Ġengine . skin , ĠBlock . ATTRIBUTE . VISIBLE , ĠBlock . ATTRIBUTE . OUT LINE ) Ċĉĉĉĉĉĉ ĉ if ( blk . to Char ()== covered . to Char ()) Ġ{ Ċĉĉĉĉĉĉĉ ĉ if (! blk . getAttribute ( Block . ATTRIBUTE . G ARB AGE )) Ġ{ Ċĉĉĉĉĉĉĉĉ ĉ blk . color Ġ= ĠBlock . COLOR . WHITE Ċĉĉĉĉĉĉĉĉ ĉ blk . setAttribute ( true , ĠBlock . ATTRIBUTE . G ARB AGE ) Ċĉĉĉĉĉĉĉ ĉ } Ċĉĉĉĉĉĉĉ ĉ blk . dark ness Ġ= Ġ 0 . 9 f Ċĉĉĉĉĉĉĉ ĉ blk . elapsed Frames Ġ= Ġ- 1 Ċĉĉĉĉĉĉ ĉ } Ċĉĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ engine . stat c [ 0 ] ++ Ċĉĉĉ ĉ } Ċĉĉĉ ĉ engine . stat c [ 0 ]== field . height + 1 Ġ-> Ġ{ Ċĉĉĉĉ ĉ engine . play SE (" game over ") Ċĉĉĉĉ ĉ engine . stat c [ 0 ] ++ Ċĉĉĉ ĉ } Ċĉĉĉ ĉ engine . stat c [ 0 ]< field . height + 1 + 1 8 0 Ġ-> Ġ{ Ċĉĉĉĉ ĉ if ( engine . stat c [ 0 ] >= field . height + 1 + 6 0 && engine . ctrl . is Push ( Controller . BUTTON _ A )) Ġ{ Ċĉĉĉĉĉ ĉ engine . stat c [ 0 ] Ġ= Ġfield . height + 1 + 1 8 0 Ċĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ engine . stat c [ 0 ] ++ Ċĉĉĉ ĉ } Ċĉĉĉ ĉ else Ġ-> Ġ{ Ċĉĉĉĉ ĉ if (! owner . replay Mode || owner . replay R er ec ord ) Ġowner . save Replay () Ċĉĉĉĉ ĉ for ( i Ġin Ġ 0 Ġuntil Ġowner . players ) Ġ{ Ċĉĉĉĉĉ ĉ if ( i == player ID || engine . game over All ) Ġ{ Ċĉĉĉĉĉĉ ĉ owner . engine [ i ]. field . reset () Ċĉĉĉĉĉĉ ĉ owner . engine [ i ]. reset Stat c () Ċĉĉĉĉĉĉ ĉ owner . engine [ i ]. stat Ġ= ĠGame Engine . Status . RESULT Ċĉĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ } Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ġelse Ġ{ Ċĉĉ ĉ // Ġ å¾ © æ´» ãģ§ãģįãĤĭ ãģ¨ ãģį Ċĉĉ ĉ if ( engine . stat c [ 0 ]== 0 ) Ġ{ Ċĉĉĉ ĉ engine . block Show Outline Only Ġ= Ġfalse Ċĉĉĉ ĉ engine . play SE (" di ed ") Ċĉĉĉ ĉ engine . reset Field Visible () Ċĉĉĉ ĉ for ( i Ġin Ġfield . hidden Height *- 1 Ġuntil Ġfield . height ) Ċĉĉĉĉ ĉ for ( j Ġin Ġ 0 Ġuntil Ġfield . width ) Ċĉĉĉĉĉ ĉ field . getBlock ( j , Ġi )?. apply Ġ{ color Ġ= ĠBlock . COLOR . BLACK } ĊĊĉĉĉ ĉ engine . stat c [ 0 ] Ġ= Ġ 1 Ċĉĉ ĉ } Ċĉĉ ĉ if (! field . isEmpty ) Ġ{ Ċĉĉĉ ĉ field . push Down () Ċĉĉ ĉ } Ġelse Ġif ( engine . stat c [ 1 ]< engine . are ) Ġ{ Ċĉĉĉ ĉ engine . stat c [ 1 ] ++ Ċĉĉ ĉ } Ġelse Ġ{ Ċĉĉĉ ĉ engine . li ves -- Ċĉĉĉ ĉ engine . reset Stat c () Ċĉĉĉ ĉ engine . stat Ġ= ĠGame Engine . Status . CUSTOM Ċĉĉ ĉ } Ċĉ ĉ } Ċĉ ĉ return Ġtrue Ċ ĉ } ĊĊ ĉ private Ġfun Ġcaught Mine ( engine : Game Engine ) Ġ{ Ċĉ ĉ val Ġdummy Block Ġ= ĠBlock ( Block . COLOR . RED , ĠBlock . TYPE . GE M ) Ċĉ ĉ if (! engine . game Active ) Ġreturn Ċĉ ĉ engine . play SE (" b omb ") Ċĉ ĉ receiver . block Break ( engine , Ġcursor X , Ġcursor Y , Ġdummy Block ) Ċĉ ĉ main Grid . un cover All M ines () Ċĉ ĉ update Block Grid ( engine ) Ċĉ ĉ update Engine Grid ( engine ) Ċĉ ĉ for ( y Ġin Ġ 0 Ġuntil Ġmin Of ( MAX _ DIM , Ġheight )) Ċĉĉ ĉ for ( x Ġin Ġ 0 Ġuntil Ġmin Of ( MAX _ DIM , Ġlength )) Ġ{ Ċĉĉĉ ĉ val Ġblk Ġ= Ġengine . field . getBlock ( x , Ġy ) Ċĉĉĉ ĉ if ( blk ?. color == Block . COLOR . RED && blk . is Gem Block ) Ċĉĉĉĉ ĉ receiver . block Break ( engine , Ġx , Ġy , Ġdummy Block ) Ċĉĉ ĉ } Ċĉ ĉ // ĉĉĉ ĉ for Ġ( int Ġy Ġ= Ġ 0 ; Ġy Ġ< Ġheight ; Ġy ++) Ġ{ Ċĉ ĉ // ĉĉĉĉ ĉ for Ġ( int Ġx Ġ= Ġ 0 ; Ġx Ġ< Ġlength ; Ġx ++) Ġ{ Ċĉ ĉ // ĉĉĉĉĉ ĉ if Ġ( main Grid . get Square At ( x , Ġy ). is Mine ) Ġengine . field . getBlock ( x , Ġy ). copy ( mine ); Ċĉ ĉ // ĉĉĉĉ ĉ } Ċĉ ĉ // ĉĉĉ ĉ } Ċĉ ĉ engine . game Ended () Ċĉ ĉ engine . reset Stat c () Ċĉ ĉ engine . stat Ġ= ĠGame Engine . Status . GAME OVER Ċ ĉ } ĊĊ ĉ override Ġfun Ġon Custom ( engine : Game Engine , Ġplayer ID : Int ): Boolean Ġ{ Ċĉ ĉ if ( engine . game Active ) Ġ{ Ċĉĉ ĉ // ĠBlock Ġmine Ġ= Ġnew ĠBlock ( Block . COLOR . GE M _ RED , Ġengine . get Skin (), ĠBlock . ATTRIBUTE . VISIBLE ); Ċĉĉ ĉ // ĠBlock Ġopen Ġ= Ġnew ĠBlock ( Block . COLOR . WHITE , Ġengine . get Skin (), ĠBlock . ATTRIBUTE . VISIBLE ); Ċĉĉ ĉ val Ġdummy Block Ġ= ĠBlock ( Block . COLOR . RED , ĠBlock . TYPE . GE M ) Ċĉĉ ĉ var Ġchange X Ġ= Ġ 0 Ċĉĉ ĉ var Ġchange Y Ġ= Ġ 0 Ċĉĉ ĉ if ( engine . ctrl . is Press ( Controller . BUTTON _ LEFT )) Ġ{ Ċĉĉĉ ĉ if ( engine . ctrl . is Push ( Controller . BUTTON _ LEFT )|| engine . ctrl . is Press ( Controller . BUTTON _ E )) Ġ{ Ċĉĉĉĉ ĉ cursor X Ġ-= Ġ 1 Ċĉĉĉĉ ĉ change X Ġ+= Ġ- 1 Ċĉĉĉĉ ĉ if ( cursor X < 0 ) Ġcursor X Ġ= Ġlength - 1 Ċĉĉĉĉ ĉ engine . play SE (" change ") Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ċĉĉ ĉ if ( engine . ctrl . is Press ( Controller . BUTTON _ RIGHT )) Ġ{ Ċĉĉĉ ĉ if ( engine . ctrl . is Push ( Controller . BUTTON _ RIGHT )|| engine . ctrl . is Press ( Controller . BUTTON _ E )) Ġ{ Ċĉĉĉĉ ĉ cursor X Ġ+= Ġ 1 Ċĉĉĉĉ ĉ change X Ġ+= Ġ 1 Ċĉĉĉĉ ĉ if ( cursor X >= length ) Ġcursor X Ġ= Ġ 0 Ċĉĉĉĉ ĉ engine . play SE (" change ") Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ċĉĉ ĉ if ( engine . ctrl . is Press ( Controller . BUTTON _ UP )) Ġ{ Ċĉĉĉ ĉ if ( engine . ctrl . is Push ( Controller . BUTTON _ UP )|| engine . ctrl . is Press ( Controller . BUTTON _ E )) Ġ{ Ċĉĉĉĉ ĉ cursor Y Ġ-= Ġ 1 Ċĉĉĉĉ ĉ change Y Ġ+= Ġ- 1 Ċĉĉĉĉ ĉ if ( cursor Y < 0 ) Ġcursor Y Ġ= Ġheight - 1 Ċĉĉĉĉ ĉ engine . play SE (" change ") Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ċĉĉ ĉ if ( engine . ctrl . is Press ( Controller . BUTTON _ DOWN )) Ġ{ Ċĉĉĉ ĉ if ( engine . ctrl . is Push ( Controller . BUTTON _ DOWN )|| engine . ctrl . is Press ( Controller . BUTTON _ E )) Ġ{ Ċĉĉĉĉ ĉ cursor Y Ġ+= Ġ 1 Ċĉĉĉĉ ĉ change Y Ġ+= Ġ 1 Ċĉĉĉĉ ĉ if ( cursor Y >= height ) Ġcursor Y Ġ= Ġ 0 Ċĉĉĉĉ ĉ engine . play SE (" change ") Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ċĉĉ ĉ cursor Screen X Ġ+= Ġchange X Ċĉĉ ĉ cursor Screen Y Ġ+= Ġchange Y Ċĉĉ ĉ if ( length > 2 0 ) Ġ{ Ċĉĉĉ ĉ when Ġ{ Ċĉĉĉĉ ĉ cursor X == 0 Ġ-> Ġ{ Ċĉĉĉĉĉ ĉ cursor Screen X Ġ= Ġ 0 Ċĉĉĉĉĉ ĉ offset X Ġ= Ġ 0 Ċĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ cursor X == length - 1 Ġ-> Ġ{ Ċĉĉĉĉĉ ĉ cursor Screen X Ġ= ĠMAX _ DIM - 1 Ċĉĉĉĉĉ ĉ offset X Ġ= Ġlength - MAX _ DIM Ċĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ cursor Screen X < 0 Ġ-> Ġ{ Ċĉĉĉĉĉ ĉ cursor Screen X Ġ= Ġ 0 Ċĉĉĉĉĉ ĉ offset X -- Ċĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ cursor Screen X >= MAX _ DIM Ġ-> Ġ{ Ċĉĉĉĉĉ ĉ cursor Screen X Ġ= ĠMAX _ DIM - 1 Ċĉĉĉĉĉ ĉ offset X ++ Ċĉĉĉĉ ĉ } Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ġelse Ġ{ Ċĉĉĉ ĉ cursor Screen X Ġ= Ġcursor X Ċĉĉ ĉ } Ċĉĉ ĉ if ( height > 2 0 ) Ġ{ Ċĉĉĉ ĉ when Ġ{ Ċĉĉĉĉ ĉ cursor Y == 0 Ġ-> Ġ{ Ċĉĉĉĉĉ ĉ cursor Screen Y Ġ= Ġ 0 Ċĉĉĉĉĉ ĉ offset Y Ġ= Ġ 0 Ċĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ cursor Y == height - 1 Ġ-> Ġ{ Ċĉĉĉĉĉ ĉ cursor Screen Y Ġ= ĠMAX _ DIM - 1 Ċĉĉĉĉĉ ĉ offset Y Ġ= Ġheight - MAX _ DIM Ċĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ cursor Screen Y < 0 Ġ-> Ġ{ Ċĉĉĉĉĉ ĉ cursor Screen Y Ġ= Ġ 0 Ċĉĉĉĉĉ ĉ offset Y -- Ċĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ cursor Screen Y >= MAX _ DIM Ġ-> Ġ{ Ċĉĉĉĉĉ ĉ cursor Screen Y Ġ= ĠMAX _ DIM - 1 Ċĉĉĉĉĉ ĉ offset Y ++ Ċĉĉĉĉ ĉ } Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ġelse Ġ{ Ċĉĉĉ ĉ cursor Screen Y Ġ= Ġcursor Y Ċĉĉ ĉ } Ċĉĉ ĉ // ĠIN ĠORDER : Ġcycle Ġstate , Ġun cover , Ġch ord Ġun cover , Ġch ord Ġflag Ċĉĉ ĉ if ( engine . ctrl . is Push ( Controller . BUTTON _ B )) Ġ{ Ċĉĉĉ ĉ engine . play SE ( if ( main Grid . cycle State ( cursor X , Ġcursor Y )) Ġ" hold " Ġelse Ġ" hold fail ") Ċĉĉ ĉ } Ġelse Ġif ( engine . ctrl . is Push ( Controller . BUTTON _ A )) Ġ{ Ċĉĉĉ ĉ if ( first Click ) Ġ{ Ċĉĉĉĉ ĉ first Click Ġ= Ġfalse Ċĉĉĉĉ ĉ main Grid . generate M ines ( cursor X , Ġcursor Y ) Ċĉĉĉ ĉ } Ċĉĉĉ ĉ when ( main Grid . un cover At ( cursor X , Ġcursor Y )) Ġ{ Ċĉĉĉĉ ĉ Game Grid . State . M INE Ġ-> Ġ{ Ċĉĉĉĉĉ ĉ caught Mine ( engine ) Ċĉĉĉĉĉ ĉ return Ġtrue Ċĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ Game Grid . State . SAFE Ġ-> Ġ{ Ċĉĉĉĉĉ ĉ receiver . block Break ( engine , Ġcursor X , Ġcursor Y , ĠBlock ( Block . COLOR . WHITE )) Ċĉĉĉĉĉ ĉ if ( numberOf Cover > main Grid . covered S quares && time Limit > 0 ) Ġ{ Ċĉĉĉĉĉĉ ĉ val Ġbonus Count : Int Ġ= ĠnumberOf Cover - main Grid . covered S quares Ċĉĉĉĉĉĉ ĉ current Limit Ġ+= ĠTIME B ON US _ S QUARE * bonus Count Ċĉĉĉĉĉĉ ĉ numberOf Cover Ġ= Ġmain Grid . covered S quares Ċĉĉĉĉĉ ĉ } Ċĉĉĉĉĉ ĉ engine . play SE (" erase 0 ") Ċĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ else Ġ-> Ġengine . play SE (" hold fail ") Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ġelse Ġif ( engine . ctrl . is Push ( Controller . BUTTON _ C )) Ġ{ Ċĉĉĉ ĉ if (! first Click && main Grid . get Sur rounding M ines ( cursor X , Ġcursor Y )> 0 && Ċĉĉĉĉ ĉ main Grid . get Square At ( cursor X , Ġcursor Y ). un covered && Ċĉĉĉĉ ĉ main Grid . get Sur rounding Flags ( cursor X , Ġcursor Y )== main Grid . get Sur rounding M ines ( cursor X , Ġcursor Y )) Ġ{ Ċĉĉĉĉ ĉ val Ġtest Locations Ġ= ĠarrayOf ( int ArrayOf (- 1 , Ġ- 1 ), Ġint ArrayOf ( 0 , Ġ- 1 ), Ġint ArrayOf ( 1 , Ġ- 1 ), Ġint ArrayOf (- 1 , Ġ 0 ), Ċĉĉĉĉĉ ĉ int ArrayOf ( 1 , Ġ 0 ), Ġint ArrayOf (- 1 , Ġ 1 ), Ġint ArrayOf ( 0 , Ġ 1 ), Ġint ArrayOf ( 1 , Ġ 1 )) Ċĉĉĉĉ ĉ for ( loc Ġin Ġtest Locations ) Ġ{ Ċĉĉĉĉĉ ĉ receiver . block Break ( engine , Ġcursor X , Ġcursor Y , ĠBlock ( Block . COLOR . WHITE )) Ċĉĉĉĉĉ ĉ val Ġpx Ġ= Ġcursor X + loc [ 0 ] Ċĉĉĉĉĉ ĉ val Ġpy Ġ= Ġcursor Y + loc [ 1 ] Ċĉĉĉĉĉ ĉ if ( px < 0 || px >= length ) Ġcontinue Ċĉĉĉĉĉ ĉ if ( py < 0 || py >= height ) Ġcontinue Ċĉĉĉĉĉ ĉ if ( main Grid . un cover At ( px , Ġpy )== Game Grid . State . M INE ) Ġ{ Ċĉĉĉĉĉĉ ĉ caught Mine ( engine ) Ċĉĉĉĉĉĉ ĉ return Ġtrue Ċĉĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ if ( numberOf Cover > main Grid . covered S quares && time Limit > 0 ) Ġ{ Ċĉĉĉĉĉ ĉ val Ġbonus Count : Int Ġ= ĠnumberOf Cover - main Grid . covered S quares Ċĉĉĉĉĉ ĉ current Limit Ġ+= ĠTIME B ON US _ S QUARE * bonus Count Ċĉĉĉĉĉ ĉ numberOf Cover Ġ= Ġmain Grid . covered S quares Ċĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ engine . play SE (" lock ") Ċĉĉĉ ĉ } Ġelse Ġ{ Ċĉĉĉĉ ĉ engine . play SE (" hold fail ") Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ġelse Ġif ( engine . ctrl . is Push ( Controller . BUTTON _ D )) Ġ{ Ċĉĉĉ ĉ if (! first Click && main Grid . get Square At ( cursor X , Ġcursor Y ). un covered && main Grid . get Sur rounding Cover ed ( cursor X , Ċĉĉĉĉĉ ĉ cursor Y )== main Grid . get Sur rounding M ines ( cursor X , Ġcursor Y )) Ġ{ Ċĉĉĉĉ ĉ val Ġtest Locations Ġ= ĠarrayOf ( int ArrayOf (- 1 , Ġ- 1 ), Ġint ArrayOf ( 0 , Ġ- 1 ), Ġint ArrayOf ( 1 , Ġ- 1 ), Ġint ArrayOf (- 1 , Ġ 0 ), Ċĉĉĉĉĉ ĉ int ArrayOf ( 1 , Ġ 0 ), Ġint ArrayOf (- 1 , Ġ 1 ), Ġint ArrayOf ( 0 , Ġ 1 ), Ġint ArrayOf ( 1 , Ġ 1 )) Ċĉĉĉĉ ĉ for ( loc Ġin Ġtest Locations ) Ġ{ Ċĉĉĉĉĉ ĉ val Ġpx Ġ= Ġcursor X + loc [ 0 ] Ċĉĉĉĉĉ ĉ val Ġpy Ġ= Ġcursor Y + loc [ 1 ] Ċĉĉĉĉĉ ĉ if ( px < 0 || px >= length ) Ġcontinue Ċĉĉĉĉĉ ĉ if ( py < 0 || py >= height ) Ġcontinue Ċĉĉĉĉĉ ĉ if (! main Grid . get Square At ( px , Ġpy ). un covered ) Ġ{ Ċĉĉĉĉĉĉ ĉ main Grid . get Square At ( px , Ġpy ). flag ged Ġ= Ġtrue Ċĉĉĉĉĉĉ ĉ main Grid . get Square At ( px , Ġpy ). question Ġ= Ġfalse Ċĉĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ engine . play SE (" hold ") Ċĉĉĉ ĉ } Ġelse Ġ{ Ċĉĉĉĉ ĉ engine . play SE (" hold fail ") Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ċĉĉ ĉ update Block Grid ( engine ) Ċĉĉ ĉ update Engine Grid ( engine ) Ċĉĉ ĉ numberOf Cover Ġ= Ġmain Grid . covered S quares Ċĉĉ ĉ if ( current Limit > 0 && time Limit > 0 ) Ġ{ Ċĉĉĉ ĉ current Limit -- Ċĉĉĉ ĉ if ( current Limit % 1 5 == 0 && current Limit <= 6 0 0 ) Ġengine . play SE ( Ċĉĉĉĉ ĉ " countdown ") Ġelse Ġif ( current Limit % 6 0 == 0 && current Limit <= 1 8 0 0 ) Ġengine . play SE (" countdown ") Ċĉĉ ĉ } Ġelse Ġif ( time Limit > 0 ) Ġ{ Ċĉĉĉ ĉ engine . li ves Ġ= Ġ 0 Ċĉĉĉ ĉ caught Mine ( engine ) Ċĉĉĉ ĉ return Ġtrue Ċĉĉ ĉ } Ċĉĉ ĉ if ( main Grid . covered S quares == main Grid . min es && main Grid . min es > 0 ) Ġ{ Ċĉĉĉ ĉ main Grid . un cover Non M ines () Ċĉĉĉ ĉ main Grid . flag All Cover ed () Ċĉĉĉ ĉ update Block Grid ( engine ) Ċĉĉĉ ĉ update Engine Grid ( engine ) ĊĊĉĉĉ ĉ // ĉĉ ĉ for Ġ( int Ġy Ġ= Ġ 0 ; Ġy Ġ< Ġheight ; Ġy ++) Ġ{ Ċĉĉĉ ĉ // ĉĉĉ ĉ for Ġ( int Ġx Ġ= Ġ 0 ; Ġx Ġ< Ġlength ; Ġx ++) Ġ{ Ċĉĉĉ ĉ // ĉĉĉĉ ĉ if Ġ( main Grid . get Square At ( x , Ġy ). un covered ) Ġengine . field . getBlock ( x , Ġy ). copy ( open ); Ċĉĉĉ ĉ // ĉĉĉ ĉ } Ċĉĉĉ ĉ // ĉĉ ĉ } Ċĉĉĉ ĉ engine . game Ended () Ċĉĉĉ ĉ engine . stat Ġ= ĠGame Engine . Status . EX CELL ENT Ċĉĉĉ ĉ engine . ending Ġ= Ġ 1 Ċĉĉĉ ĉ engine . reset Stat c () Ċĉĉĉ ĉ return Ġtrue Ċĉĉ ĉ } Ċĉĉ ĉ if ( engine . ending == 0 ) Ġengine . timer Active Ġ= Ġtrue Ċĉĉ ĉ engine . stat c [ 0 ] ++ Ċĉ ĉ } Ġelse Ġ{ Ċĉĉ ĉ engine . isIn Game Ġ= Ġtrue Ċĉĉ ĉ val Ġs : Boolean Ġ= Ġengine . player Prop . login Screen . update Screen ( engine , Ġplayer ID ) Ċĉĉ ĉ if ( engine . player Prop . is LoggedIn ) Ġ{ Ċĉĉĉ ĉ load Setting Player ( engine . player Prop ) Ċĉĉ ĉ } Ċĉĉ ĉ if ( engine . stat === Game Engine . Status . SETTING ) Ġengine . isIn Game Ġ= Ġfalse Ċĉ ĉ } Ċĉ ĉ return Ġtrue Ċ ĉ } ĊĊ ĉ private Ġfun Ġupdate Block Grid ( engine : Game Engine ) Ġ{ Ċĉ ĉ val Ġcovered Ġ= ĠBlock ( Block . COLOR . BLUE , Ġengine . skin , Ċĉĉ ĉ Block . ATTRIBUTE . VISIBLE , ĠBlock . ATTRIBUTE . OUT LINE ) Ċĉ ĉ val Ġopen Ġ= ĠBlock ( Block . COLOR . WHITE , Ġengine . skin , ĠBlock . ATTRIBUTE . VISIBLE ) Ċĉ ĉ val Ġmine Ġ= ĠBlock ( Block . COLOR . RED , ĠBlock . TYPE . GE M , Ġengine . skin , ĠBlock . ATTRIBUTE . VISIBLE ) Ċĉ ĉ for ( y Ġin Ġblock Grid . indices ) Ġ{ Ċĉĉ ĉ for ( x Ġin Ġ 0 Ġuntil Ġblock Grid [ y ]. size ) Ġ{ Ċĉĉĉ ĉ if ( main Grid . get Square At ( x , Ġy ). un covered ) Ġ{ Ċĉĉĉĉ ĉ if (! main Grid . get Square At ( x , Ġy ). is Mine ) Ġ{ Ċĉĉĉĉĉ ĉ if ( block Grid [ y ][ x ] !!. to Char ()!= open . to Char ()) Ġblock Grid [ y ][ x ] !!. copy ( open ) Ċĉĉĉĉ ĉ } Ġelse Ġ{ Ċĉĉĉĉĉ ĉ if ( block Grid [ y ][ x ] !!. to Char ()!= mine . to Char ()) Ġblock Grid [ y ][ x ] !!. copy ( mine ) Ċĉĉĉĉ ĉ } Ċĉĉĉ ĉ } Ġelse Ġ{ Ċĉĉĉĉ ĉ if ( block Grid [ y ][ x ] !!. to Char ()!= covered . to Char ()) Ġ{ Ċĉĉĉĉĉ ĉ block Grid [ y ][ x ] !!. copy ( covered ) Ċĉĉĉĉ ĉ } Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ private Ġfun Ġupdate Engine Grid ( engine : Game Engine ) Ġ{ Ċĉ ĉ for ( y Ġin Ġ 0 Ġuntil Ġif ( height > 2 0 ) ĠMAX _ DIM Ġelse Ġheight ) Ġ{ Ċĉĉ ĉ for ( x Ġin Ġ 0 Ġuntil Ġif ( length > 2 0 ) ĠMAX _ DIM Ġelse Ġlength ) Ġ{ Ċĉĉĉ ĉ val Ġpx Ġ= Ġx + offset X Ċĉĉĉ ĉ val Ġpy Ġ= Ġy + offset Y Ċĉĉĉ ĉ if ( engine . field . getBlock ( x , Ġy )?. to Char ()!= block Grid [ py ][ px ] !!. to Char ()) Ġ{ Ċĉĉĉĉ ĉ engine . field . getBlock ( x , Ġy )?. copy ( block Grid [ py ][ px ]) Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ override Ġfun Ġrender Last ( engine : Game Engine , Ġplayer ID : Int ) Ġ{ Ċĉ ĉ if ( owner . menu Only ) Ġreturn Ċĉ ĉ var Ġix Ġ= Ġ( if ( length < MAX _ DIM ) Ġlength Ġelse ĠMAX _ DIM )- 1 0 Ċĉ ĉ if ( ix < 0 ) Ġix Ġ= Ġ 0 Ċĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġix , Ġ 0 , Ġname , ĠCOLOR . BLUE ) Ċĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġix , Ġ 1 , Ġ"(" +( length * height *( mine Percentage / 1 0 0 f )). toInt ()+" ĠMIN ES )", Ċĉĉ ĉ COLOR . BLUE ) Ċĉ ĉ if ( engine . stat === Game Engine . Status . SETTING || engine . stat === Game Engine . Status . RESULT && ! owner . replay Mode ) Ġ{ Ċĉĉ ĉ if ( engine . player Prop . is LoggedIn ) Ġ{ Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġix , Ġ 3 , Ġ" PLAYER ", ĠCOLOR . BLUE ) Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġix , Ġ 4 , Ġengine . player Prop . name Display , ĠCOLOR . WHITE , Ġ 2 f ) Ċĉĉ ĉ } Ġelse Ġ{ Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġix , Ġ 3 , Ġ" LOGIN ĠSTATUS ", ĠCOLOR . BLUE ) Ċĉĉĉ ĉ if (! engine . player Prop . is LoggedIn ) Ġreceiver . draw Score Font ( engine , Ġplayer ID , Ġix , Ġ 4 , Ġ"( NOT ĠLOG GED ĠIN )\ n ( E : LOG ĠIN )") Ċĉĉ ĉ } Ċĉ ĉ } Ġelse Ġif ( engine . stat === Game Engine . Status . CUSTOM && ! engine . game Active ) Ġ{ Ċĉĉ ĉ engine . player Prop . login Screen . render Screen ( receiver , Ġengine , Ġplayer ID ) Ċĉ ĉ } Ġelse Ġ{ Ċĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġix , Ġ 3 , Ġ" TIME ", ĠCOLOR . BLUE ) Ċĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġix , Ġ 4 , Ġengine . statistics . time . to Time Str ) Ċĉĉ ĉ if ( time Limit > 0 ) Ġ{ Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġix , Ġ 9 , Ġ" TIME ĠLIMIT ", ĠCOLOR . RED ) Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġix , Ġ 1 0 , Ġcurrent Limit . to Time Str , Ċĉĉĉĉ ĉ current Limit <= 1 8 0 0 && engine . statistics . time / 2 % 2 == 0 ) Ċĉĉ ĉ } Ċĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġix , Ġ 6 , Ġ" FLAGS ĠLEFT ", ĠCOLOR . BLUE ) Ċĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġix , Ġ 7 , Ġ( main Grid . min es - main Grid . flag ged S quares ). toString ()) ĊĊĉĉ ĉ if ( main Grid . min es > 0 ) Ġ{ Ċĉĉĉ ĉ val Ġm : Int Ġ= Ġmain Grid . min es - main Grid . flag ged S quares Ċĉĉĉ ĉ val Ġproportion : Float Ġ= Ġm . toFloat ()/ main Grid . min es Ċĉĉĉ ĉ engine . meter Value Ġ= Ġm * receiver . get Meter Max ( engine )/ main Grid . min es Ċĉĉĉ ĉ engine . meter Color Ġ= ĠGame Engine . METER _ COLOR _ RED Ċĉĉĉ ĉ if ( pro portion <= 0 . 7 5 f ) Ġengine . meter Color Ġ= ĠGame Engine . METER _ COLOR _ OR ANGE Ċĉĉĉ ĉ if ( pro portion <= 0 . 5 f ) Ġengine . meter Color Ġ= ĠGame Engine . METER _ COLOR _ YELLOW Ċĉĉĉ ĉ if ( pro portion <= 0 . 2 5 f ) Ġengine . meter Color Ġ= ĠGame Engine . METER _ COLOR _ GREEN Ċĉĉ ĉ } Ċĉĉ ĉ // ĠBlock Ġcovered Ġ= Ġnew ĠBlock ( Block . COLOR . BLUE , Ġengine . get Skin (), ĠBlock . ATTRIBUTE . VISIBLE Ġ| ĠBlock . ATTRIBUTE . OUT LINE ); Ċĉĉ ĉ // ĠBlock Ġopen Ġ= Ġnew ĠBlock ( Block . COLOR . WHITE , Ġengine . get Skin (), ĠBlock . ATTRIBUTE . VISIBLE ); Ċĉĉ ĉ // ĠBlock Ġmine Ġ= Ġnew ĠBlock ( Block . COLOR . GE M _ RED , Ġengine . get Skin (), ĠBlock . ATTRIBUTE . VISIBLE ); Ċĉĉ ĉ if ( engine . stat === Game Engine . Status . CUSTOM ) Ġ{ Ċĉĉĉ ĉ if ( height <= MAX _ DIM && length <= MAX _ DIM ) Ġ{ Ċĉĉĉĉ ĉ for ( y Ġin Ġ 0 Ġuntil Ġheight ) Ġ{ Ċĉĉĉĉĉ ĉ for ( x Ġin Ġ 0 Ġuntil Ġlength ) Ġ{ Ċĉĉĉĉĉĉ ĉ if ( main Grid . get Square At ( x , Ġy ). un covered ) Ġ{ Ċĉĉĉĉĉĉĉ ĉ if (! main Grid . get Square At ( x , Ġy ). is Mine ) Ġ{ Ċĉĉĉĉĉĉĉĉ ĉ val Ġs Ġ= Ġmain Grid . get Sur rounding M ines ( x , Ġy ) Ċĉĉĉĉĉĉĉĉ ĉ if ( s > 0 ) Ġ{ Ċĉĉĉĉĉĉĉĉĉ ĉ var Ġc Ġ= ĠCOLOR . PIN K Ċĉĉĉĉĉĉĉĉĉ ĉ if ( s == 2 ) Ġc Ġ= ĠCOLOR . GREEN Ġelse Ġif ( s == 3 ) Ġc Ġ= ĠCOLOR . CO B ALT Ġelse Ġif ( s == 4 ) Ġc Ġ= ĠCOLOR . RED Ġelse Ġif ( s == 5 ) Ġc Ġ= ĠCOLOR . CY AN Ġelse Ġif ( s == 6 ) Ġc Ġ= ĠCOLOR . YELLOW Ġelse Ġif ( s == 7 ) Ġc Ġ= ĠCOLOR . PUR PLE Ġelse Ġif ( s == 8 ) Ġc Ġ= ĠCOLOR . OR ANGE Ċĉĉĉĉĉĉĉĉĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġx , Ġy , Ġ"$ s ", Ġc ) Ċĉĉĉĉĉĉĉĉ ĉ } Ċĉĉĉĉĉĉĉ ĉ } Ċĉĉĉĉĉĉ ĉ } Ġelse Ġ{ Ċĉĉĉĉĉĉĉ ĉ if ( main Grid . get Square At ( x , Ġy ). flag ged ) Ġ{ Ċĉĉĉĉĉĉĉĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġx , Ġy , Ġ" b ", ĠCOLOR . RED ) Ċĉĉĉĉĉĉĉ ĉ } Ġelse Ġif ( main Grid . get Square At ( x , Ġy ). question ) Ġ{ Ċĉĉĉĉĉĉĉĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġx , Ġy , Ġ"? ") Ċĉĉĉĉĉĉĉ ĉ } Ċĉĉĉĉĉĉ ĉ } Ċĉĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ } Ċĉĉĉ ĉ } Ġelse Ġ{ Ċĉĉĉĉ ĉ for ( y Ġin Ġ 0 Ġuntil Ġif ( height <= MAX _ DIM ) Ġheight Ġelse ĠMAX _ DIM ) Ġ{ Ċĉĉĉĉĉ ĉ for ( x Ġin Ġ 0 Ġuntil Ġif ( length <= MAX _ DIM ) Ġlength Ġelse ĠMAX _ DIM ) Ġ{ Ċĉĉĉĉĉĉ ĉ val Ġpx : Int Ġ= Ġx + offset X Ċĉĉĉĉĉĉ ĉ val Ġpy : Int Ġ= Ġy + offset Y Ċĉĉĉĉĉĉ ĉ if ( main Grid . get Square At ( px , Ġpy ). un covered ) Ġ{ Ċĉĉĉĉĉĉĉ ĉ if (! main Grid . get Square At ( px , Ġpy ). is Mine ) Ġ{ Ċĉĉĉĉĉĉĉĉ ĉ val Ġs : Int Ġ= Ġmain Grid . get Sur rounding M ines ( px , Ġpy ) Ċĉĉĉĉĉĉĉĉ ĉ if ( s > 0 ) Ġ{ Ċĉĉĉĉĉĉĉĉĉ ĉ var Ġc Ġ= ĠCOLOR . PIN K Ċĉĉĉĉĉĉĉĉĉ ĉ if ( s == 2 ) Ġc Ġ= ĠCOLOR . GREEN Ġelse Ġif ( s == 3 ) Ġc Ġ= ĠCOLOR . CO B ALT Ġelse Ġif ( s == 4 ) Ġc Ġ= ĠCOLOR . RED Ġelse Ġif ( s == 5 ) Ġc Ġ= ĠCOLOR . CY AN Ġelse Ġif ( s == 6 ) Ġc Ġ= ĠCOLOR . YELLOW Ġelse Ġif ( s == 7 ) Ġc Ġ= ĠCOLOR . PUR PLE Ġelse Ġif ( s == 8 ) Ġc Ġ= ĠCOLOR . OR ANGE Ċĉĉĉĉĉĉĉĉĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġx , Ġy , Ġ"$ s ", Ġc ) Ċĉĉĉĉĉĉĉĉ ĉ } Ċĉĉĉĉĉĉĉ ĉ } Ċĉĉĉĉĉĉ ĉ } Ġelse Ġ{ Ċĉĉĉĉĉĉĉ ĉ if ( main Grid . get Square At ( px , Ġpy ). flag ged ) Ġ{ Ċĉĉĉĉĉĉĉĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġx , Ġy , Ġ" b ", ĠCOLOR . RED ) Ċĉĉĉĉĉĉĉ ĉ } Ġelse Ġif ( main Grid . get Square At ( px , Ġpy ). question ) Ġ{ Ċĉĉĉĉĉĉĉĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġx , Ġy , Ġ"? ") Ċĉĉĉĉĉĉĉ ĉ } Ċĉĉĉĉĉĉ ĉ } Ċĉĉĉĉĉ ĉ } Ċĉĉĉĉ ĉ } Ċĉĉĉ ĉ } Ċĉĉĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġcursor Screen X , Ġcursor Screen Y , Ġ" f ", ĠCOLOR . YELLOW ) Ċĉĉĉ ĉ val Ġf offset X : Int Ġ= Ġreceiver . field X ( engine , Ġplayer ID )+ 4 Ċĉĉĉ ĉ val Ġf offset Y : Int Ġ= Ġreceiver . field Y ( engine , Ġplayer ID )+ 5 2 Ċĉĉĉ ĉ val Ġsize Ġ= Ġ 1 6 Ċĉĉĉ ĉ if ( length > MAX _ DIM ) Ġ{ Ċĉĉĉĉ ĉ if ( offset X != 0 ) Ġreceiver . draw Direct Font ( fo ffset X - 2 * size , Ġf offset Y +( 9 . 5 * size ). toInt (), Ġ"< ", Ċĉĉĉĉĉ ĉ COLOR . YELLOW ) Ċĉĉĉĉ ĉ if ( offset X != length - MAX _ DIM ) Ġreceiver . draw Direct Font ( fo ffset X + 2 1 * size , Ġf offset Y +( 9 . 5 * size ). toInt (), Ċĉĉĉĉĉ ĉ "> ", ĠCOLOR . YELLOW ) Ċĉĉĉ ĉ } Ċĉĉĉ ĉ if ( height > MAX _ DIM ) Ġ{ Ċĉĉĉĉ ĉ if ( offset Y != 0 ) Ġreceiver . draw Direct Font ( fo ffset X +( 9 . 5 * size ). toInt (), Ġf offset Y - 2 * size , Ġ" k ", Ċĉĉĉĉĉ ĉ COLOR . YELLOW ) Ċĉĉĉĉ ĉ if ( offset Y != length - MAX _ DIM ) Ġreceiver . draw Direct Font ( fo ffset X +( 9 . 5 * size ). toInt (), Ġf offset Y + 2 1 * size , Ċĉĉĉĉĉ ĉ " n ", ĠCOLOR . YELLOW ) Ċĉĉĉ ĉ } Ċĉĉ ĉ } Ċĉĉ ĉ if ( engine . player Prop . is LoggedIn || engine . player Name . isNotEmpty ()) Ġ{ Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 0 , Ġ 2 0 , Ġ" PLAYER ", ĠCOLOR . BLUE ) Ċĉĉĉ ĉ receiver . draw Score Font ( engine , Ġplayer ID , Ġ 0 , Ġ 2 1 , Ċĉĉĉĉ ĉ if ( owner . replay Mode ) Ġengine . player Name Ġelse Ġengine . player Prop . name Display , Ċĉĉĉĉ ĉ COLOR . WHITE , Ġ 2 f ) Ċĉĉ ĉ } Ċĉ ĉ } Ċ ĉ } Ċ ĉ /* Ċĉĉ Ġ* ĠRender Ġresults Ġscreen Ċĉĉ Ġ*/ Ċ ĉ override Ġfun Ġrender Result ( engine : Game Engine , Ġplayer ID : Int ) Ġ{ Ċĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġ 0 , Ġ 0 , Ġ" TIME ", ĠCOLOR . BLUE ) Ċĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġ 0 , Ġ 1 , ĠString . format ("% 1 0 s ", Ġengine . statistics . time . to Time Str )) Ċĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġ 0 , Ġ 2 , Ġ" MIN ES ", ĠCOLOR . RED ) Ċĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġ 0 , Ġ 3 , ĠString . format ("% 1 0 s ", Ġmain Grid . min es )) Ċĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġ 0 , Ġ 4 , Ġ" RE MAIN ING ", ĠCOLOR . GREEN ) Ċĉ ĉ receiver . draw Menu Font ( engine , Ġplayer ID , Ġ 0 , Ġ 5 , ĠString . format ("% 1 0 s ", Ġmain Grid . min es - main Grid . flag ged S quares )) Ċ ĉ } Ċ ĉ /* Ċĉĉ Ġ* ĠCalled Ġwhen Ġsaving Ġreplay Ċĉĉ Ġ*/ Ċ ĉ override Ġfun Ġsave Replay ( engine : Game Engine , Ġplayer ID : Int , Ġprop : Custom Properties ) Ġ{ Ċĉ ĉ save Setting ( prop ) Ċĉ ĉ if (! owner . replay Mode ) Ġ{ Ċĉĉ ĉ owner . save Mode Config () Ċĉ ĉ } Ċ ĉ } Ċ ĉ /** Ċĉ Ġ* ĠLoad Ġsettings Ġfrom Ġ[ prop ] Ċĉ Ġ* Ċĉ Ġ* Ġ@ param Ġprop ĠProperty Ġfile Ċĉ Ġ*/ Ċ ĉ override Ġfun Ġload Setting ( prop : Custom Properties ) Ġ{ Ċĉ ĉ length Ġ= Ġprop . getProperty (" min es w eeper . length ", Ġ 1 5 ) Ċĉ ĉ height Ġ= Ġprop . getProperty (" min es w eeper . height ", Ġ 1 5 ) Ċĉ ĉ mine Percentage Ġ= Ġprop . getProperty (" min es w eeper . mine Percentage ", Ġ 1 5 f ) Ċĉ ĉ bg m Ġ= Ġprop . getProperty (" min es w eeper . bg m ", Ġ 0 ) Ċĉ ĉ bg Ġ= Ġprop . getProperty (" min es w eeper . bg ", Ġ 0 ) Ċĉ ĉ time Limit Ġ= Ġprop . getProperty (" min es w eeper . time Limit ", Ġ 0 ) Ċ ĉ } Ċ ĉ /** Ċĉ Ġ* ĠSave Ġsettings Ġto Ġ[ prop ] Ċĉ Ġ* Ċĉ Ġ* Ġ@ param Ġprop ĠProperty Ġfile Ċĉ Ġ*/ Ċ ĉ override Ġfun Ġsave Setting ( prop : Custom Properties ) Ġ{ Ċĉ ĉ prop . setProperty (" min es w eeper . length ", Ġlength ) Ċĉ ĉ prop . setProperty (" min es w eeper . height ", Ġheight ) Ċĉ ĉ prop . setProperty (" min es w eeper . mine Percentage ", Ġmine Percentage ) Ċĉ ĉ prop . setProperty (" min es w eeper . bg m ", Ġbg m ) Ċĉ ĉ prop . setProperty (" min es w eeper . bg ", Ġbg ) Ċĉ ĉ prop . setProperty (" min es w eeper . time Limit ", Ġtime Limit ) Ċ ĉ } Ċ ĉ /** Ċĉ Ġ* ĠLoad Ġsettings Ġfrom Ġ[ prop ] Ċĉ Ġ* Ċĉ Ġ* Ġ@ param Ġprop ĠProperty Ġfile Ċĉ Ġ*/ Ċ ĉ private Ġfun Ġload Setting Player ( prop : Profile Properties ) Ġ{ Ċĉ ĉ length Ġ= Ġprop . getProperty (" min es w eeper . length ", Ġ 1 5 ) Ċĉ ĉ height Ġ= Ġprop . getProperty (" min es w eeper . height ", Ġ 1 5 ) Ċĉ ĉ mine Percentage Ġ= Ġprop . getProperty (" min es w eeper . mine Percentage ", Ġ 1 5 f ) Ċĉ ĉ bg m Ġ= Ġprop . getProperty (" min es w eeper . bg m ", Ġ 0 ) Ċĉ ĉ bg Ġ= Ġprop . getProperty (" min es w eeper . bg ", Ġ 0 ) Ċĉ ĉ time Limit Ġ= Ġprop . getProperty (" min es w eeper . time Limit ", Ġ 0 ) Ċ ĉ } Ċ ĉ /** Ċĉ Ġ* ĠSave Ġsettings Ġto Ġ[ prop ] Ċĉ Ġ* Ċĉ Ġ* Ġ@ param Ġprop ĠProperty Ġfile Ċĉ Ġ*/ Ċ ĉ private Ġfun Ġsave Setting Player ( prop : Profile Properties ) Ġ{ Ċĉ ĉ prop . setProperty (" min es w eeper . length ", Ġlength ) Ċĉ ĉ prop . setProperty (" min es w eeper . height ", Ġheight ) Ċĉ ĉ prop . setProperty (" min es w eeper . mine Percentage ", Ġmine Percentage ) Ċĉ ĉ prop . setProperty (" min es w eeper . bg m ", Ġbg m ) Ċĉ ĉ prop . setProperty (" min es w eeper . bg ", Ġbg ) Ċĉ ĉ prop . setProperty (" min es w eeper . time Limit ", Ġtime Limit ) Ċ ĉ } ĊĊ ĉ comp anion Ġobject Ġ{ Ċĉ ĉ private Ġconst Ġval ĠMAX _ DIM Ġ= Ġ 2 0 Ċĉ ĉ private Ġconst Ġval ĠTIME B ON US _ S QUARE Ġ= Ġ 9 Ċĉ ĉ private Ġval Ġheader Color Ġ= ĠCOLOR . YELLOW Ċ ĉ } Ċ }