/// <summary> /// 局面に合わせて、駒ボタンのx,y位置を変更します /// </summary> /// <param name="btnKoma">駒</param> public static void Redraw_KomaLocation( Finger figKoma, NarabeRoomViewModel shogiGui ) { RO_Star_Koma koma = Util_Koma.AsKoma(shogiGui.GameViewModel.GuiSkyConst.StarlightIndexOf(figKoma).Now); Shape_BtnKoma btnKoma = Util_InGui.FingerToKomaBtn(figKoma, shogiGui); int suji; int dan; Util_MasuNum.MasuToSuji(koma.Masu, out suji); Util_MasuNum.MasuToDan(koma.Masu, out dan); switch (Util_Masu.GetOkiba(koma.Masu)) { case Okiba.ShogiBan: btnKoma.SetBounds(new Rectangle( shogiGui.Shape_PnlTaikyoku.Shogiban.SujiToX(suji), shogiGui.Shape_PnlTaikyoku.Shogiban.DanToY(dan), btnKoma.Bounds.Width, btnKoma.Bounds.Height )); break; case Okiba.Sente_Komadai: btnKoma.SetBounds(new Rectangle( shogiGui.Shape_PnlTaikyoku.KomadaiArr[0].SujiToX(suji), shogiGui.Shape_PnlTaikyoku.KomadaiArr[0].DanToY(dan), btnKoma.Bounds.Width, btnKoma.Bounds.Height )); break; case Okiba.Gote_Komadai: btnKoma.SetBounds(new Rectangle( shogiGui.Shape_PnlTaikyoku.KomadaiArr[1].SujiToX(suji), shogiGui.Shape_PnlTaikyoku.KomadaiArr[1].DanToY(dan), btnKoma.Bounds.Width, btnKoma.Bounds.Height )); break; case Okiba.KomaBukuro: btnKoma.SetBounds(new Rectangle( shogiGui.Shape_PnlTaikyoku.KomadaiArr[2].SujiToX(suji), shogiGui.Shape_PnlTaikyoku.KomadaiArr[2].DanToY(dan), btnKoma.Bounds.Width, btnKoma.Bounds.Height )); break; } }
/// <summary> /// ************************************************************************************************************************ /// [巻戻し]ボタン /// ************************************************************************************************************************ /// </summary> public static bool Makimodosi_Gui( NarabeRoomViewModel shogiGui, Finger movedKoma, Finger foodKoma, string fugoJStr, string backedInputText) { //------------------------------ // チェンジターン //------------------------------ shogiGui.ChangeTurn();//[巻戻し]ボタンを押したあと //------------------------------ // 符号表示 //------------------------------ shogiGui.Shape_PnlTaikyoku.SetFugo(fugoJStr); Shape_BtnKoma btn_movedKoma = Util_InGui.FingerToKomaBtn(movedKoma, shogiGui); Shape_BtnKoma btn_foodKoma = Util_InGui.FingerToKomaBtn(foodKoma, shogiGui);//取られた駒 //------------------------------------------------------------ // 駒・再描画 //------------------------------------------------------------ if ( null != btn_movedKoma //動かした駒 || null != btn_foodKoma //取ったときに下にあった駒(巻戻しのときは、これは無し) ) { shogiGui.ResponseData.RedrawStarlights();// 駒の再描画要求 } // 巻き戻したので、符号が入ります。 { shogiGui.ResponseData.InputTextString = fugoJStr + " " + backedInputText;// 入力欄 shogiGui.ResponseData.OutputTxt = ResponseGedanTxt.Kifu; } shogiGui.ResponseData.ToRedraw(); return(true); }