package Ġcom . github . g mk or ni lov . chess board . model . moves Ċ Ċ import Ġcom . github . g mk or ni lov . chess board . model . Board Ċ import Ġcom . github . g mk or ni lov . chess board . model . Cell Info Ċ import Ġcom . github . g mk or ni lov . chess board . model . pieces . King Ċ import Ġcom . github . g mk or ni lov . chess board . model . pieces . Piece Ċ Ċ internal Ġclass ĠKing Transition Move ( piece : ĠKing , Ġfrom : ĠCell Info , Ġto : ĠCell Info ) Ġ: ĠTransition Move ( piece , Ġfrom , Ġto ) Ġ{ ĊĠĠĠ Ġvar Ġold Can White Castle Short Ġ= Ġfalse ĊĠĠĠ Ġvar Ġold Can White Castle Long Ġ= Ġfalse ĊĠĠĠ Ġvar Ġold Can Black Castle Short Ġ= Ġfalse ĊĠĠĠ Ġvar Ġold Can Black Castle Long Ġ= Ġfalse ĊĊĠĠĠ Ġoverride Ġfun Ġmove ( board : ĠBoard ) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . move ( board ) ĊĊĠĠĠĠĠĠĠ Ġold Can White Castle Short Ġ= Ġboard . can White Castle Short ĊĠĠĠĠĠĠĠ Ġold Can White Castle Long Ġ= Ġboard . can White Castle Long ĊĠĠĠĠĠĠĠ Ġold Can Black Castle Short Ġ= Ġboard . can Black Castle Short ĊĠĠĠĠĠĠĠ Ġold Can Black Castle Long Ġ= Ġboard . can Black Castle Long ĊĊĠĠĠĠĠĠĠ Ġif Ġ( piece . is White ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġboard . can White Castle Long Ġ= Ġfalse ĊĠĠĠĠĠĠĠĠĠĠĠ Ġboard . can White Castle Short Ġ= Ġfalse ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġboard . white King Position Ġ= Ġto ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġboard . can Black Castle Short Ġ= Ġfalse ĊĠĠĠĠĠĠĠĠĠĠĠ Ġboard . can Black Castle Long Ġ= Ġfalse ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġboard . black King Position Ġ= Ġto ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġundo ( board : ĠBoard ) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . undo ( board ) ĊĊĠĠĠĠĠĠĠ Ġboard . can White Castle Short Ġ= Ġold Can White Castle Short ĊĠĠĠĠĠĠĠ Ġboard . can White Castle Long Ġ= Ġold Can White Castle Long ĊĠĠĠĠĠĠĠ Ġboard . can Black Castle Short Ġ= Ġold Can Black Castle Short ĊĠĠĠĠĠĠĠ Ġboard . can Black Castle Long Ġ= Ġold Can Black Castle Long ĊĊĠĠĠĠĠĠĠ Ġif Ġ( piece . is White ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġboard . white King Position Ġ= Ġfrom ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġboard . black King Position Ġ= Ġfrom ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }