package Ġus . wh od ag . acquire . sm Ċ Ċ import Ġus . wh od ag . acquire . obj . player . Player Id Ċ Ċ /** Ċ Ġ* ĠAc quire Ġstate Ġmachine Ġstate Ġwhich Ġis Ġtracked Ġmost Ġof Ġthe Ġgame . Ċ Ġ* Ċ Ġ* Ġ@ property Ġplayer Turn Order Ġthe Ġplayers Ġin Ġgame Ġin Ġorder Ġof Ġtheir Ġturns . Ċ Ġ* Ġ@ property Ġcurrent Player Ġthe Ġplayer Ġwhose Ġcurrent Ġturn Ġit Ġis . Ċ Ġ*/ Ċ data Ġclass ĠGameState ( val Ġplayer Turn Order : ĠList < Player Id >, ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġcurrent Player : ĠPlayer Id ) Ċ Ċ /** ĠWhether Ġthe Ġspecified Ġplayer Ġis Ġthe Ġcurrent Ġplayer . Ġ*/ Ċ fun ĠGameState . is Current Player ( player : ĠPlayer Id ) Ġ= Ġplayer Ġ== Ġcurrent Player Ċ Ċ /** ĠWhether Ġthe Ġspecified Ġplayer Ġis Ġnot Ġthe Ġcurrent Ġplayer . Ġ*/ Ċ fun ĠGameState . isNot Current Player ( player : ĠPlayer Id ) Ġ= Ġplayer Ġ!= Ġcurrent Player Ċ Ċ /** ĠThe Ġplayer Ġwhose Ġturn Ġis Ġnext . Ġ*/ Ċ fun ĠGameState . next Current Player (): ĠPlayer Id Ġ{ ĊĠĠĠ Ġrequire (! player Turn Order . isEmpty (), Ġ{ Ġ" Player Ġturn Ġorder Ġneeds Ġto Ġbe Ġdefined " Ġ}) ĊĠĠĠ Ġval Ġi Ġ= Ġplayer Turn Order . indexOf ( current Player ) ĊĠĠĠ Ġreturn Ġif Ġ( i Ġ+ Ġ 1 Ġ>= Ġplayer Turn Order . size ) Ġplayer Turn Order . first () ĊĠĠĠ Ġelse Ġplayer Turn Order [ i Ġ+ Ġ 1 ] Ċ } Ċ