コード例 #1
0
        public override void Step3_SetEvent(object obj_shogiGui)
        {
            MainGui_Csharp shogibanGui1 = (MainGui_Csharp)obj_shogiGui;

            //----------
            // 将棋エンジン起動ボタン_学習
            //----------
            {
                UserWidget widget = shogibanGui1.GetWidget("BtnShogiEngineKidoL");
                widget.Delegate_MouseHitEvent = Event_CsharpVsImpl.GetInstance().Delegate_BtnShogiEngineKidoL;
            }

            //----------
            // 将棋エンジン起動ボタン_CP起動
            //----------
            {
                UserWidget widget = shogibanGui1.GetWidget("BtnShogiEngineKidoF");
                widget.Delegate_MouseHitEvent = Event_CsharpVsImpl.GetInstance().Delegate_BtnComputerBoot;
            }

            //----------
            // 将棋エンジン起動ボタン_CP先
            //----------
            {
                UserWidget widget = shogibanGui1.GetWidget("BtnShogiEngineKidoT");
                widget.Delegate_MouseHitEvent = Event_CsharpVsImpl.GetInstance().Delegate_BtnComputerSente;
            }
        }
コード例 #2
0
            internal static unsafe void Invoke(IntPtr obj, UserWidget Widget)
            {
                long *p = stackalloc long[] { 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = Widget;
                Main.GetProcessEvent(obj, SetWidget_ptr, new IntPtr(p));;
            }
        }
コード例 #3
0
        /// <summary>
        /// Creates a widget based on the parameters
        /// and links that widget to a dasboard.
        /// </summary>
        public Widget AddWidget(WidgetType widgetType, string title, int rowNbr, int colNbr, List <PropertyTag> proptags, DateTime?timestamp = null,
                                GraphType?graphType = null, int rowspan = 1, int colspan = 1, int dashboardId = -1, List <WidgetData> datas = null, List <Item> items = null)
        {
            InitRepo();
            Widget widget;

            //Checks if a userwidget or an itemWidget needs to be created
            if (dashboardId == -1)
            {
                widget = new ItemWidget();
            }
            else
            {
                widget = new UserWidget();
            }

            //Check if timestamp was given
            if (timestamp == null)
            {
                timestamp = DateTime.Now.AddMonths(-1);
            }

            widget.WidgetType   = widgetType;
            widget.Title        = title;
            widget.RowNumber    = rowNbr;
            widget.ColumnNumber = colNbr;
            widget.RowSpan      = rowspan;
            widget.ColumnSpan   = colspan;
            widget.Timestamp    = timestamp;
            widget.Items        = items ?? new List <Item>();
            if (graphType != 0)
            {
                widget.GraphType = graphType;
            }
            widget.PropertyTags = proptags;

            //Check for adding widgetData
            if (datas == null)
            {
                widget.WidgetDatas = new List <WidgetData>();
            }
            else
            {
                widget.WidgetDatas = datas;
            }

            //Update database
            if (dashboardId != -1)
            {
                Dashboard dasboardToAddWidget = widgetRepo.ReadDashboardWithWidgets(dashboardId);
                dasboardToAddWidget.Widgets.Add((UserWidget)widget);
            }
            widgetRepo.CreateWidget(widget);
            return(widget);
        }
コード例 #4
0
        public ActionResult Delete(long id)
        {
            UserWidget entity = repoWrapper.UserWidget.Get(id);

            if (entity == null)
            {
                return(BadRequest("Value with the given id is null"));
            }
            repoWrapper.UserWidget.Delete(entity);
            repoWrapper.Save();
            return(Ok());
        }
コード例 #5
0
        public override void Step3_SetEvent(object obj_shogiGui)
        {
            NarabeRoomViewModel shogiGui1 = (NarabeRoomViewModel)obj_shogiGui;

            //----------
            // 将棋エンジン起動ボタン
            //----------
            {
                UserWidget widget = shogiGui1.Shape_PnlTaikyoku.GetWidget("BtnShogiEngineKido");
                widget.Delegate_MouseHitEvent = (
                    object obj_shogiGui2
                    , Shape_BtnKoma btnKoma_Selected
                    ) =>
                {
                    NarabeRoomViewModel shogiGui = (NarabeRoomViewModel)obj_shogiGui2;

                    Ui_PnlMain ui_PnlMain = ((Ui_ShogiForm1)shogiGui.OwnerForm).Ui_PnlMain1;

                    ui_PnlMain.ShogiGui.Start(ui_PnlMain.SetteiFile.ShogiEngineFilePath);
                };
            }
        }
コード例 #6
0
        public virtual void Step3_SetEvent(object obj_shogiGui)
        {
            NarabeRoomViewModel shogiGui1 = (NarabeRoomViewModel)obj_shogiGui;

            //----------
            // [成る]ボタン
            //----------
            {
                UserWidget widget = shogiGui1.Shape_PnlTaikyoku.GetWidget("BtnNaru");
                widget.Delegate_MouseHitEvent = (
                    object obj_shogiGui2
                    , Shape_BtnKoma btnKoma_Selected
                    ) =>
                {
                    NarabeRoomViewModel shogiGui = (NarabeRoomViewModel)obj_shogiGui2;

                    Ui_PnlMain ui_PnlMain = ((Ui_ShogiForm1)shogiGui.OwnerForm).Ui_PnlMain1;


                    shogiGui.Shape_PnlTaikyoku.SetNaruFlag(true);
                    this.After_NaruNaranai(
                        shogiGui
                        , btnKoma_Selected
                        );
                };
            }

            //----------
            // [成らない]ボタン
            //----------
            {
                UserWidget widget = shogiGui1.Shape_PnlTaikyoku.GetWidget("BtnNaranai");
                widget.Delegate_MouseHitEvent = (
                    object obj_shogiGui2
                    , Shape_BtnKoma btnKoma_Selected
                    ) =>
                {
                    NarabeRoomViewModel shogiGui = (NarabeRoomViewModel)obj_shogiGui2;

                    Ui_PnlMain ui_PnlMain = ((Ui_ShogiForm1)shogiGui.OwnerForm).Ui_PnlMain1;

                    shogiGui.Shape_PnlTaikyoku.SetNaruFlag(false);
                    this.After_NaruNaranai(
                        shogiGui
                        , btnKoma_Selected
                        );
                };
            }

            //----------
            // [クリアー]ボタン
            //----------
            {
                UserWidget widget = shogiGui1.Shape_PnlTaikyoku.GetWidget("BtnClear");
                widget.Delegate_MouseHitEvent = (
                    object obj_shogiGui2
                    , Shape_BtnKoma btnKoma_Selected
                    ) =>
                {
                    NarabeRoomViewModel shogiGui = (NarabeRoomViewModel)obj_shogiGui2;

                    Util_Lua_KifuNarabe.ShogiGui = shogiGui;
                    Util_Lua_KifuNarabe.Perform("click_clearButton");
                };
            }

            //----------
            // [再生]ボタン
            //----------
            {
                UserWidget widget = shogiGui1.Shape_PnlTaikyoku.GetWidget("BtnPlay");
                widget.Delegate_MouseHitEvent = (
                    object obj_shogiGui2
                    , Shape_BtnKoma btnKoma_Selected
                    ) =>
                {
                    NarabeRoomViewModel shogiGui = (NarabeRoomViewModel)obj_shogiGui2;

                    Util_Lua_KifuNarabe.ShogiGui = shogiGui;
                    Util_Lua_KifuNarabe.Perform("click_playButton");
                };
            }

            //----------
            // [コマ送り]ボタン
            //----------
            {
                UserWidget widget = shogiGui1.Shape_PnlTaikyoku.GetWidget("BtnForward");
                widget.Delegate_MouseHitEvent = (
                    object obj_shogiGui2
                    , Shape_BtnKoma btnKoma_Selected
                    ) =>
                {
                    NarabeRoomViewModel shogiGui = (NarabeRoomViewModel)obj_shogiGui2;

                    string restText = Util_InGui.ReadLine_FromTextbox();
                    Util_InServer.Komaokuri_Srv(ref restText, shogiGui);
                    Util_InGui.Komaokuri_Gui(restText, shogiGui);
                    Util_Menace.Menace(shogiGui);// メナス
                };
            }

            //----------
            // [巻戻し]ボタン
            //----------
            {
                UserWidget widget = shogiGui1.Shape_PnlTaikyoku.GetWidget("BtnBackward");
                widget.Delegate_MouseHitEvent = (
                    object obj_shogiGui2
                    , Shape_BtnKoma btnKoma_Selected
                    ) =>
                {
                    NarabeRoomViewModel shogiGui = (NarabeRoomViewModel)obj_shogiGui2;

                    Ui_PnlMain ui_PnlMain = ((Ui_ShogiForm1)shogiGui.OwnerForm).Ui_PnlMain1;

                    Finger movedKoma;
                    Finger foodKoma;//取られた駒
                    string fugoJStr;

                    if (!Util_InServer.Makimodosi_Srv(out movedKoma, out foodKoma, out fugoJStr, shogiGui))
                    {
                        goto gt_EndBlock;
                    }

                    Util_InGui.Makimodosi_Gui(shogiGui, movedKoma, foodKoma, fugoJStr, Util_InGui.ReadLine_FromTextbox());
                    Util_Menace.Menace(shogiGui);//メナス

gt_EndBlock:
                    ;
                };
            }


            //----------
            // ログ出せボタン
            //----------
            {
                UserWidget widget = shogiGui1.Shape_PnlTaikyoku.GetWidget("BtnLogdase");
                widget.Delegate_MouseHitEvent = (
                    object obj_shogiGui2
                    , Shape_BtnKoma btnKoma_Selected
                    ) =>
                {
                    NarabeRoomViewModel shogiGui = (NarabeRoomViewModel)obj_shogiGui2;

                    Ui_PnlMain ui_PnlMain = ((Ui_ShogiForm1)shogiGui.OwnerForm).Ui_PnlMain1;

                    ui_PnlMain.ShogiGui.Logdase();
                };
            }



            //----------
            // [壁置く]ボタン
            //----------
            {
                UserWidget widget = shogiGui1.Shape_PnlTaikyoku.GetWidget("BtnKabeOku");
                widget.Delegate_MouseHitEvent = (
                    object obj_shogiGui2
                    , Shape_BtnKoma btnKoma_Selected
                    ) =>
                {
                    NarabeRoomViewModel shogiGui = (NarabeRoomViewModel)obj_shogiGui2;

                    Ui_PnlMain ui_PnlMain = ((Ui_ShogiForm1)shogiGui.OwnerForm).Ui_PnlMain1;

                    // [壁置く]←→[駒動かす]切替
                    switch (widget.Text)
                    {
                    case "壁置く":
                        widget.Text = "駒動かす";
                        break;

                    default:
                        widget.Text = "壁置く";
                        break;
                    }

                    shogiGui.ResponseData.ToRedraw();
                };
            }


            //----------
            // [出力切替]ボタン
            //----------
            {
                UserWidget widget = shogiGui1.Shape_PnlTaikyoku.GetWidget("BtnSyuturyokuKirikae");
                widget.Delegate_MouseHitEvent = (
                    object obj_shogiGui2
                    , Shape_BtnKoma btnKoma_Selected
                    ) =>
                {
                    NarabeRoomViewModel shogiGui = (NarabeRoomViewModel)obj_shogiGui2;

                    Ui_PnlMain ui_PnlMain = ((Ui_ShogiForm1)shogiGui.OwnerForm).Ui_PnlMain1;

                    switch (shogiGui.Shape_PnlTaikyoku.SyuturyokuKirikae)
                    {
                    case SyuturyokuKirikae.Japanese:
                        shogiGui.Shape_PnlTaikyoku.SetSyuturyokuKirikae(SyuturyokuKirikae.Sfen);
                        break;

                    case SyuturyokuKirikae.Sfen:
                        shogiGui.Shape_PnlTaikyoku.SetSyuturyokuKirikae(SyuturyokuKirikae.Html);
                        break;

                    case SyuturyokuKirikae.Html:
                        shogiGui.Shape_PnlTaikyoku.SetSyuturyokuKirikae(SyuturyokuKirikae.Japanese);
                        break;
                    }

                    shogiGui.ResponseData.OutputTxt = ResponseGedanTxt.Kifu;
                };
            }

            //----------
            // [▲]~[打]符号ボタン
            //----------
            {
                string[] buttonNames = new string[] {
                    "BtnFugo_Sente"    // [▲]~[打]符号ボタン
                    , "BtnFugo_Gote"
                    , "BtnFugo_1"
                    , "BtnFugo_2"
                    , "BtnFugo_3"
                    , "BtnFugo_4"
                    , "BtnFugo_5"
                    , "BtnFugo_6"
                    , "BtnFugo_7"
                    , "BtnFugo_8"
                    , "BtnFugo_9"
                    , "BtnFugo_Dou"
                    , "BtnFugo_Fu"
                    , "BtnFugo_Hisya"
                    , "BtnFugo_Kaku"
                    , "BtnFugo_Kyo"
                    , "BtnFugo_Kei"
                    , "BtnFugo_Gin"
                    , "BtnFugo_Kin"
                    , "BtnFugo_Oh"
                    , "BtnFugo_Gyoku"
                    , "BtnFugo_Tokin"
                    , "BtnFugo_Narikyo"
                    , "BtnFugo_Narikei"
                    , "BtnFugo_Narigin"
                    , "BtnFugo_Ryu"
                    , "BtnFugo_Uma"
                    , "BtnFugo_Yoru"
                    , "BtnFugo_Hiku"
                    , "BtnFugo_Agaru"
                    , "BtnFugo_Migi"
                    , "BtnFugo_Hidari"
                    , "BtnFugo_Sugu"
                    , "BtnFugo_Nari"
                    , "BtnFugo_Funari"
                    , "BtnFugo_Da"
                };

                foreach (string buttonName in buttonNames)
                {
                    UserWidget widget = shogiGui1.Shape_PnlTaikyoku.GetWidget(buttonName);
                    widget.Delegate_MouseHitEvent = (
                        object obj_shogiGui2
                        , Shape_BtnKoma btnKoma_Selected
                        ) =>
                    {
                        NarabeRoomViewModel shogiGui = (NarabeRoomViewModel)obj_shogiGui2;

                        Ui_PnlMain ui_PnlMain = ((Ui_ShogiForm1)shogiGui.OwnerForm).Ui_PnlMain1;

                        shogiGui.ResponseData.SetAppendInputTextString(shogiGui.Shape_PnlTaikyoku.GetWidget(buttonName).Fugo);
                    };
                }
            }


            //----------
            // [全消]ボタン
            //----------
            {
                UserWidget widget = shogiGui1.Shape_PnlTaikyoku.GetWidget("BtnFugo_Zenkesi");
                widget.Delegate_MouseHitEvent = (
                    object obj_shogiGui2
                    , Shape_BtnKoma btnKoma_Selected
                    ) =>
                {
                    NarabeRoomViewModel shogiGui = (NarabeRoomViewModel)obj_shogiGui2;

                    Ui_PnlMain ui_PnlMain = ((Ui_ShogiForm1)shogiGui.OwnerForm).Ui_PnlMain1;

                    shogiGui.ResponseData.InputTextString = "";
                };
            }


            //----------
            // [ここから採譜]ボタン
            //----------
            {
                UserWidget widget = shogiGui1.Shape_PnlTaikyoku.GetWidget("BtnFugo_KokokaraSaifu");
                widget.Delegate_MouseHitEvent = (
                    object obj_shogiGui2
                    , Shape_BtnKoma btnKoma_Selected
                    ) =>
                {
                    NarabeRoomViewModel shogiGui = (NarabeRoomViewModel)obj_shogiGui2;

                    Ui_PnlMain ui_PnlMain = ((Ui_ShogiForm1)shogiGui.OwnerForm).Ui_PnlMain1;

                    ui_PnlMain.ShogiGui.GameViewModel.Kifu.SetStartpos_KokokaraSaifu(Util_InServer.CurPside(ui_PnlMain.ShogiGui));
                    shogiGui.ResponseData.OutputTxt = ResponseGedanTxt.Kifu;
                };
            }

            //----------
            // 初期配置ボタン
            //----------
            {
                UserWidget widget = shogiGui1.Shape_PnlTaikyoku.GetWidget("BtnSyokihaichi");
                widget.Delegate_MouseHitEvent = (
                    object obj_shogiGui2
                    , Shape_BtnKoma btnKoma_Selected
                    ) =>
                {
                    NarabeRoomViewModel shogiGui = (NarabeRoomViewModel)obj_shogiGui2;

                    Ui_PnlMain ui_PnlMain = ((Ui_ShogiForm1)shogiGui.OwnerForm).Ui_PnlMain1;

                    WidgetsLoader_KifuNarabe.Perform_SyokiHaichi(ui_PnlMain);
                };
            }


            //----------
            // [向き]ボタン
            //----------
            {
                UserWidget widget = shogiGui1.Shape_PnlTaikyoku.GetWidget("BtnMuki");
                widget.Delegate_MouseHitEvent = (
                    object obj_shogiGui2
                    , Shape_BtnKoma btnKoma_Selected
                    ) =>
                {
                    NarabeRoomViewModel shogiGui = (NarabeRoomViewModel)obj_shogiGui2;

                    Ui_PnlMain ui_PnlMain = ((Ui_ShogiForm1)shogiGui.OwnerForm).Ui_PnlMain1;

                    Shape_BtnKoma movedKoma = shogiGui.Shape_PnlTaikyoku.Btn_MovedKoma();

                    RO_Star_Koma koma;
                    Finger       figKoma = Fingers.Error_1;

                    if (null != movedKoma)
                    {
                        //>>>>> 移動直後の駒があるとき
                        koma    = Util_Koma.AsKoma(ui_PnlMain.ShogiGui.GameViewModel.GuiSkyConst.StarlightIndexOf(movedKoma.Finger).Now);
                        figKoma = movedKoma.Finger;
                    }
                    else if (null != btnKoma_Selected)
                    {
                        //>>>>> 選択されている駒があるとき
                        koma    = Util_Koma.AsKoma(ui_PnlMain.ShogiGui.GameViewModel.GuiSkyConst.StarlightIndexOf(btnKoma_Selected.Koma).Now);
                        figKoma = btnKoma_Selected.Koma;
                    }
                    else
                    {
                        koma = null;
                    }

                    if (null != koma)
                    {
                        switch (koma.Pside)
                        {
                        case Playerside.P1:
                        {
                            SkyBuffer buffer_Sky = new SkyBuffer(ui_PnlMain.ShogiGui.GameViewModel.GuiSkyConst);

                            buffer_Sky.AddOverwriteStarlight(figKoma, new RO_MotionlessStarlight(
                                                                 //figKoma,
                                                                 new RO_Star_Koma(Playerside.P2,
                                                                                  koma.Masu,
                                                                                  Haiyaku184Array.Syurui(koma.Haiyaku))
                                                                 ));

                            KifuNode modifyNode = new KifuNodeImpl(
                                ui_PnlMain.ShogiGui.GameViewModel.Kifu.CurNode.Key,                                //現在の局面を流用
                                new KyokumenWrapper(new SkyConst(buffer_Sky)),
                                ((KifuNode)ui_PnlMain.ShogiGui.GameViewModel.Kifu.CurNode).Tebanside
                                );

                            // ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
                            // ここで局面データを変更します。
                            // ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
                            Util_InServer.SetCurNode_Srv(ui_PnlMain.ShogiGui, modifyNode);
                            ui_PnlMain.ShogiGui.ResponseData.ToRedraw();
                        }
                        break;

                        case Playerside.P2:
                        {
                            SkyBuffer buffer_Sky = new SkyBuffer(ui_PnlMain.ShogiGui.GameViewModel.GuiSkyConst);

                            buffer_Sky.AddOverwriteStarlight(figKoma, new RO_MotionlessStarlight(
                                                                 //figKoma,
                                                                 new RO_Star_Koma(Playerside.P1,
                                                                                  koma.Masu,
                                                                                  Haiyaku184Array.Syurui(koma.Haiyaku))
                                                                 ));

                            KifuNode modifyNode =
                                new KifuNodeImpl(
                                    ui_PnlMain.ShogiGui.GameViewModel.Kifu.CurNode.Key,        //現在の局面を流用
                                    new KyokumenWrapper(new SkyConst(buffer_Sky)),
                                    ((KifuNode)ui_PnlMain.ShogiGui.GameViewModel.Kifu.CurNode).Tebanside
                                    );


                            // ここで局面データを変更します。
                            Util_InServer.SetCurNode_Srv(ui_PnlMain.ShogiGui, modifyNode);
                            ui_PnlMain.ShogiGui.ResponseData.ToRedraw();
                        }
                        break;
                        }
                    }
                };
            }
        }
コード例 #7
0
ファイル: WidgetComponent.cs プロジェクト: jcoder58/Plugins
 ///<summary>Sets the widget to use directly.</summary>
 ///<remarks>
 ///This function will keep track of the widget till the next time it's called
 ///    with either a newer widget or a nullptr
 ///</remarks>
 public void SetWidget(UserWidget Widget) =>
 WidgetComponent_methods.SetWidget_method.Invoke(ObjPointer, Widget);
コード例 #8
0
        public override void Step()
        {
            // 入っているマウス操作イベントのうち、マウスムーブは 1つに 集約 します。
            bool bMouseMove_SceneB_1TumamitaiKoma = false;

            // 入っているマウス操作イベントは、全部捨てていきます。
            MouseEventState[] queue = this.MouseEventQueue.ToArray();
            this.MouseEventQueue.Clear();
            foreach (MouseEventState eventState in queue)
            {
                switch (this.shogiGui.Scene)
                {
                case SceneName.SceneB_1TumamitaiKoma:
                {
                    #region つまみたい駒


                    switch (eventState.Name2)
                    {
                    case MouseEventStateName.Arive:
                    {
                        #region アライブ
                        //------------------------------
                        // メナス
                        //------------------------------
                        Util_Menace.Menace(this.shogiGui);
                        #endregion
                    }
                    break;

                    case MouseEventStateName.MouseMove:
                    {
                        #region マウスムーブ
                        if (bMouseMove_SceneB_1TumamitaiKoma)
                        {
                            continue;
                        }
                        bMouseMove_SceneB_1TumamitaiKoma = true;

                        SkyConst src_Sky = shogiGui.GameViewModel.GuiSkyConst;

                        Point mouse = eventState.MouseLocation;

                        //----------
                        // 将棋盤:升目
                        //----------
                        foreach (UserWidget widget in shogiGui.Shape_PnlTaikyoku.Widgets.Values)
                        {
                            if ("Masu" == widget.Type && Okiba.ShogiBan == widget.Okiba)
                            {
                                Shape_BtnMasuImpl cell = (Shape_BtnMasuImpl)widget.Object;
                                cell.LightByMouse(mouse.X, mouse.Y);
                                if (cell.Light)
                                {
                                    shogiGui.ResponseData.ToRedraw();
                                }
                                break;
                            }
                        }

                        //----------
                        // 駒置き、駒袋:升目
                        //----------
                        foreach (UserWidget widget in shogiGui.Shape_PnlTaikyoku.Widgets.Values)
                        {
                            if ("Masu" == widget.Type && widget.Okiba.HasFlag(Okiba.Sente_Komadai | Okiba.Gote_Komadai | Okiba.KomaBukuro))
                            {
                                Shape_BtnMasuImpl cell = (Shape_BtnMasuImpl)widget.Object;
                                cell.LightByMouse(mouse.X, mouse.Y);
                                if (cell.Light)
                                {
                                    shogiGui.ResponseData.ToRedraw();
                                }
                            }
                        }

                        //----------
                        // 駒
                        //----------
                        foreach (Shape_BtnKomaImpl btnKoma in shogiGui.Shape_PnlTaikyoku.BtnKomaDoors)
                        {
                            btnKoma.LightByMouse(mouse.X, mouse.Y);
                            if (btnKoma.Light)
                            {
                                shogiGui.ResponseData.ToRedraw();

                                RO_Star_Koma koma = Util_Koma.AsKoma(src_Sky.StarlightIndexOf(btnKoma.Koma).Now);

                                if (Okiba.ShogiBan == Util_Masu.Masu_ToOkiba(koma.Masu))
                                {
                                    // マウスオーバーした駒の利き
                                    TimedB.Check_MouseoverKomaKiki(shogiGui, btnKoma.Koma);


                                    break;
                                }
                            }
                        }


                        foreach (UserWidget widget in shogiGui.Shape_PnlTaikyoku.Widgets.Values)
                        {
                            if (widget.IsLight_OnFlowB_1TumamitaiKoma)
                            {
                                widget.LightByMouse(mouse.X, mouse.Y);
                                if (widget.Light)
                                {
                                    shogiGui.ResponseData.ToRedraw();
                                }
                            }
                        }
                        #endregion
                    }
                    break;

                    case MouseEventStateName.MouseLeftButtonDown:
                    {
                        #region マウス左ボタンダウン
                        SceneName nextPhaseB = SceneName.Ignore;
                        SkyConst  src_Sky    = shogiGui.GameViewModel.GuiSkyConst;

                        //----------
                        // 駒
                        //----------
                        foreach (Shape_BtnKomaImpl btnKoma in shogiGui.Shape_PnlTaikyoku.BtnKomaDoors)
                        {
                            if (btnKoma.HitByMouse(eventState.MouseLocation.X, eventState.MouseLocation.Y))
                            {
                                //>>>>>>>>>> 駒にヒットしました。

                                if (null != shogiGui.Shape_PnlTaikyoku.Btn_TumandeiruKoma(shogiGui))
                                {
                                    //>>>>>>>>>> 既に選択されている駒があります。→★成ろうとしたときの、取られる相手の駒かも。
                                    goto gt_Next1;
                                }

                                // 既に選択されている駒には無効
                                if (shogiGui.Shape_PnlTaikyoku.FigTumandeiruKoma == (int)btnKoma.Koma)
                                {
                                    goto gt_Next1;
                                }



                                if (btnKoma.HitByMouse(eventState.MouseLocation.X, eventState.MouseLocation.Y))                 //>>>>> 駒をつまみました。
                                {
                                    // 駒をつまみます。
                                    shogiGui.Shape_PnlTaikyoku.SetFigTumandeiruKoma((int)btnKoma.Koma);
                                    shogiGui.Shape_PnlTaikyoku.SelectFirstTouch = true;

                                    nextPhaseB = SceneName.SceneB_2OkuKoma;

                                    shogiGui.Shape_PnlTaikyoku.SetMouseStarlightOrNull2(
                                        src_Sky.StarlightIndexOf(btnKoma.Koma)                //TODO:改造
                                        );

                                    shogiGui.Shape_PnlTaikyoku.SetHMovedKoma(Fingers.Error_1);
                                    shogiGui.ResponseData.ToRedraw();
                                }
                            }

gt_Next1:
                            ;
                        }


                        //----------
                        // 既に選択されている駒
                        //----------
                        Shape_BtnKoma btnKoma_Selected = shogiGui.Shape_PnlTaikyoku.Btn_TumandeiruKoma(shogiGui);



                        //----------
                        // 各種ボタン
                        //----------
                        {
                            foreach (UserWidget widget in shogiGui.Shape_PnlTaikyoku.Widgets.Values)
                            {
                                if (widget.HitByMouse(eventState.MouseLocation.X, eventState.MouseLocation.Y))
                                {
                                    if (null != widget.Delegate_MouseHitEvent)
                                    {
                                        widget.Delegate_MouseHitEvent(
                                            shogiGui
                                            , btnKoma_Selected
                                            );
                                    }
                                }
                            }
                        }


                        shogiGui.SetScene(nextPhaseB);

                        //------------------------------
                        // このメインパネルの反応
                        //------------------------------
                        shogiGui.Response("MouseOperation");
                        #endregion
                    }
                    break;

                    case MouseEventStateName.MouseLeftButtonUp:
                    {
                        #region マウス左ボタンアップ
                        SkyConst src_Sky = shogiGui.GameViewModel.GuiSkyConst;

                        //----------
                        // 将棋盤:升目
                        //----------
                        foreach (UserWidget widget in shogiGui.Shape_PnlTaikyoku.Widgets.Values)
                        {
                            if ("Masu" == widget.Type && Okiba.ShogiBan == widget.Okiba)
                            {
                                Shape_BtnMasuImpl cell = (Shape_BtnMasuImpl)widget.Object;
                                if (cell.DeselectByMouse(eventState.MouseLocation.X, eventState.MouseLocation.Y))
                                {
                                    shogiGui.ResponseData.ToRedraw();
                                }
                            }
                        }

                        //----------
                        // 駒置き、駒袋:升目
                        //----------
                        foreach (UserWidget widget in shogiGui.Shape_PnlTaikyoku.Widgets.Values)
                        {
                            if ("Masu" == widget.Type && widget.Okiba.HasFlag(Okiba.Sente_Komadai | Okiba.Gote_Komadai | Okiba.KomaBukuro))
                            {
                                Shape_BtnMasuImpl cell = (Shape_BtnMasuImpl)widget.Object;
                                if (cell.DeselectByMouse(eventState.MouseLocation.X, eventState.MouseLocation.Y))
                                {
                                    shogiGui.ResponseData.ToRedraw();
                                }
                            }
                        }

                        //----------
                        // 駒
                        //----------
                        foreach (Shape_BtnKomaImpl btnKoma in shogiGui.Shape_PnlTaikyoku.BtnKomaDoors)
                        {
                            if (btnKoma.HitByMouse(eventState.MouseLocation.X, eventState.MouseLocation.Y))
                            {
                                //>>>>> つまんでいる駒から、指を放しました
                                shogiGui.Shape_PnlTaikyoku.SetFigTumandeiruKoma(-1);


                                RO_Star_Koma koma1 = Util_Koma.AsKoma(src_Sky.StarlightIndexOf((int)btnKoma.Koma).Now);


                                if (Okiba.ShogiBan == Util_Masu.GetOkiba(koma1.Masu))
                                {
                                    //----------
                                    // 移動済表示
                                    //----------
                                    shogiGui.Shape_PnlTaikyoku.SetHMovedKoma(btnKoma.Koma);

                                    //------------------------------
                                    // 棋譜に符号を追加(マウスボタンが放されたとき)TODO:まだ早い。駒が成るかもしれない。
                                    //------------------------------
                                    // 棋譜

                                    Starlight dstStarlight = shogiGui.Shape_PnlTaikyoku.MouseStarlightOrNull2;
                                    System.Diagnostics.Debug.Assert(null != dstStarlight, "mouseStarlightがヌル");

                                    Starlight srcStarlight = src_Sky.StarlightIndexOf(btnKoma.Koma);
                                    System.Diagnostics.Debug.Assert(null != srcStarlight, "komaStarlightがヌル");


                                    ShootingStarlightable move = new RO_ShootingStarlight(
                                        //btnKoma.Koma,
                                        dstStarlight.Now,
                                        srcStarlight.Now,
                                        shogiGui.Shape_PnlTaikyoku.MousePos_FoodKoma != null ? shogiGui.Shape_PnlTaikyoku.MousePos_FoodKoma.Syurui : PieceType.None
                                        );                // 選択している駒の元の場所と、移動先


                                    // TODO: 一手[巻戻し]のときは追加したくない
                                    Node <ShootingStarlightable, KyokumenWrapper> newNode = new KifuNodeImpl(move,
                                                                                                             new KyokumenWrapper(new SkyConst(src_Sky)),
                                                                                                             KifuNodeImpl.GetReverseTebanside(((KifuNode)shogiGui.GameViewModel.Kifu.CurNode).Tebanside)
                                                                                                             );


                                    //マウスの左ボタンを放したときです。
                                    ((KifuNode)KifuNarabe_KifuWrapper.CurNode(shogiGui.GameViewModel.Kifu)).AppendChildA_New(newNode);
                                    Util_InServer.SetCurNode_Srv(shogiGui, newNode);
                                    shogiGui.ResponseData.ToRedraw();


                                    //------------------------------
                                    // 符号表示
                                    //------------------------------
                                    FugoJ fugoJ;

                                    RO_Star_Koma koma2 = Util_Koma.AsKoma(move.LongTimeAgo);

                                    fugoJ = JFugoCreator15Array.ItemMethods[(int)Haiyaku184Array.Syurui(koma2.Haiyaku)](move, new KyokumenWrapper(src_Sky));                //「▲2二角成」なら、馬(dst)ではなくて角(src)。


                                    shogiGui.Shape_PnlTaikyoku.SetFugo(fugoJ.ToText_UseDou(
                                                                           KifuNarabe_KifuWrapper.CurNode(shogiGui.GameViewModel.Kifu)
                                                                           ));



                                    //------------------------------
                                    // チェンジターン
                                    //------------------------------
                                    if (!shogiGui.Shape_PnlTaikyoku.Requested_NaruDialogToShow)
                                    {
                                        shogiGui.ChangeTurn();                //マウス左ボタンを放したのでチェンジターンします。
                                    }

                                    shogiGui.ResponseData.OutputTxt = ResponseGedanTxt.Kifu;
                                    shogiGui.ResponseData.ToRedraw();
                                }
                            }
                        }



                        //------------------------------------------------------------
                        // 選択解除か否か
                        //------------------------------------------------------------
                        {
                            foreach (UserWidget widget in shogiGui.Shape_PnlTaikyoku.Widgets.Values)
                            {
                                if (widget.DeselectByMouse(eventState.MouseLocation.X, eventState.MouseLocation.Y, shogiGui))
                                {
                                    shogiGui.ResponseData.ToRedraw();
                                }
                            }
                        }

                        //------------------------------
                        // このメインパネルの反応
                        //------------------------------
                        shogiGui.Response("MouseOperation");

                        #endregion
                    }
                    break;
                    }
                    #endregion
                }
                break;

                case SceneName.SceneB_2OkuKoma:
                {
                    #region 置く駒

                    switch (eventState.Name2)
                    {
                    case MouseEventStateName.MouseLeftButtonUp:
                    {
                        #region マウス左ボタンアップ
                        Node <ShootingStarlightable, KyokumenWrapper> siteiNode = KifuNarabe_KifuWrapper.CurNode(shogiGui.GameViewModel.Kifu);
                        SkyConst src_Sky = shogiGui.GameViewModel.GuiSkyConst;


                        //----------
                        // 駒
                        //----------
                        foreach (Shape_BtnKomaImpl btnKoma in shogiGui.Shape_PnlTaikyoku.BtnKomaDoors)
                        {
                            if (btnKoma.HitByMouse(eventState.MouseLocation.X, eventState.MouseLocation.Y))
                            {
                                //>>>>> マウスが重なっていました

                                if (shogiGui.Shape_PnlTaikyoku.SelectFirstTouch)
                                {
                                    // クリックのマウスアップ
                                    shogiGui.Shape_PnlTaikyoku.SelectFirstTouch = false;
                                }
                                else
                                {
                                    RO_Star_Koma koma = Util_Koma.AsKoma(src_Sky.StarlightIndexOf(btnKoma.Koma).Now);


                                    if (Okiba.ShogiBan == Util_Masu.GetOkiba(koma.Masu))
                                    {
                                        //>>>>> 将棋盤の上に置いてあった駒から、指を放しました
                                        //System.C onsole.WriteLine("つまんでいる駒を放します。(4)");
                                        shogiGui.Shape_PnlTaikyoku.SetFigTumandeiruKoma(-1);


                                        //----------
                                        // 移動済表示
                                        //----------
                                        shogiGui.Shape_PnlTaikyoku.SetHMovedKoma(btnKoma.Koma);

                                        //------------------------------
                                        // 棋譜に符号を追加(マウスボタンが放されたとき)TODO:まだ早い。駒が成るかもしれない。
                                        //------------------------------

                                        ShootingStarlightable move = new RO_ShootingStarlight(
                                            //btnKoma.Koma,
                                            shogiGui.Shape_PnlTaikyoku.MouseStarlightOrNull2.Now,

                                            src_Sky.StarlightIndexOf(btnKoma.Koma).Now,

                                            shogiGui.Shape_PnlTaikyoku.MousePos_FoodKoma != null ? shogiGui.Shape_PnlTaikyoku.MousePos_FoodKoma.Syurui : PieceType.None
                                            );                // 選択している駒の元の場所と、移動先

                                        ShootingStarlightable last;
                                        {
                                            last = siteiNode.Key;
                                        }
                                        //ShootingStarlightable previousMove = last; //符号の追加が行われる前に退避

                                        Node <ShootingStarlightable, KyokumenWrapper> newNode =
                                            new KifuNodeImpl(
                                                move,
                                                new KyokumenWrapper(new SkyConst(src_Sky)),
                                                KifuNodeImpl.GetReverseTebanside(((KifuNode)shogiGui.GameViewModel.Kifu.CurNode).Tebanside)
                                                );


                                        //マウスの左ボタンを放したときです。
                                        ((KifuNode)KifuNarabe_KifuWrapper.CurNode(shogiGui.GameViewModel.Kifu)).AppendChildA_New(newNode);
                                        Util_InServer.SetCurNode_Srv(shogiGui, newNode);
                                        shogiGui.ResponseData.ToRedraw();


                                        // ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
                                        // ここでツリーの内容は変わっている。
                                        // ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

                                        //------------------------------
                                        // 符号表示
                                        //------------------------------
                                        RO_Star_Koma koma2 = Util_Koma.AsKoma(move.LongTimeAgo);

                                        FugoJ fugoJ;

                                        fugoJ = JFugoCreator15Array.ItemMethods[(int)Haiyaku184Array.Syurui(koma2.Haiyaku)](move, new KyokumenWrapper(src_Sky));                //「▲2二角成」なら、馬(dst)ではなくて角(src)。

                                        shogiGui.Shape_PnlTaikyoku.SetFugo(fugoJ.ToText_UseDou(
                                                                               KifuNarabe_KifuWrapper.CurNode(shogiGui.GameViewModel.Kifu)
                                                                               ));



                                        //------------------------------
                                        // チェンジターン
                                        //------------------------------
                                        if (!shogiGui.Shape_PnlTaikyoku.Requested_NaruDialogToShow)
                                        {
                                            //System.C onsole.WriteLine("マウス左ボタンを放したのでチェンジターンします。");
                                            shogiGui.ChangeTurn();                //マウス左ボタンを放したのでチェンジターンします。
                                        }

                                        shogiGui.ResponseData.OutputTxt = ResponseGedanTxt.Kifu;
                                        shogiGui.ResponseData.ToRedraw();
                                    }
                                }
                            }
                        }

                        //------------------------------
                        // このメインパネルの反応
                        //------------------------------
                        shogiGui.Response("MouseOperation");
                        #endregion
                    }
                    break;

                    case MouseEventStateName.MouseLeftButtonDown:
                    {
                        #region マウス左ボタンダウン
                        SceneName nextPhaseB = SceneName.Ignore;

                        //System.C onsole.WriteLine("B2マウスダウン");

                        //----------
                        // つまんでいる駒
                        //----------
                        Shape_BtnKoma btnTumandeiruKoma = shogiGui.Shape_PnlTaikyoku.Btn_TumandeiruKoma(shogiGui);
                        if (null == btnTumandeiruKoma)
                        {
                            //System.C onsole.WriteLine("つまんでいる駒なし");
                            goto gt_nextBlock;
                        }

                        //>>>>> 選択されている駒があるとき

                        Starlight tumandeiruLight = shogiGui.GameViewModel.GuiSkyConst.StarlightIndexOf((int)btnTumandeiruKoma.Finger);


                        //----------
                        // 指したい先
                        //----------
                        Shape_BtnMasuImpl btnSasitaiMasu = null;

                        //----------
                        // 将棋盤:升目   <移動先など>
                        //----------
                        foreach (UserWidget widget in shogiGui.Shape_PnlTaikyoku.Widgets.Values)
                        {
                            if ("Masu" == widget.Type && Okiba.ShogiBan == widget.Okiba)
                            {
                                if (widget.HitByMouse(eventState.MouseLocation.X, eventState.MouseLocation.Y))                //>>>>> 指したいマスはここです。
                                {
                                    btnSasitaiMasu = (Shape_BtnMasuImpl)widget.Object;
                                    break;
                                }
                            }
                        }


                        //----------
                        // 駒置き、駒袋:升目
                        //----------
                        foreach (UserWidget widget in shogiGui.Shape_PnlTaikyoku.Widgets.Values)
                        {
                            if ("Masu" == widget.Type && widget.Okiba.HasFlag(Okiba.Sente_Komadai | Okiba.Gote_Komadai | Okiba.KomaBukuro))
                            {
                                Shape_BtnMasuImpl btnSasitaiMasu2 = (Shape_BtnMasuImpl)widget.Object;
                                if (btnSasitaiMasu2.HitByMouse(eventState.MouseLocation.X, eventState.MouseLocation.Y))                //>>>>> 升目をクリックしたとき
                                {
                                    bool match = false;

                                    shogiGui.GameViewModel.GuiSkyConst.Foreach_Starlights((Finger finger, Starlight ml, ref bool toBreak) =>
                                            {
                                                RO_Star_Koma koma = Util_Koma.AsKoma(ml.Now);

                                                if (koma.Masu == btnSasitaiMasu2.Zahyo)
                                                {
                                                    //>>>>> そこに駒が置いてあった。
#if DEBUG
                                                    // MessageBox.Show("駒が置いてあった","デバッグ中");
#endif
                                                    match   = true;
                                                    toBreak = true;
                                                }
                                            });

                                    if (!match)
                                    {
                                        btnSasitaiMasu = btnSasitaiMasu2;
                                        goto gt_EndKomaoki;
                                    }
                                }
                            }
                        }
gt_EndKomaoki:
                        ;

                        if (null == btnSasitaiMasu)
                        {
                            // 指したいマスなし
                            goto gt_nextBlock;
                        }



                        //指したいマスが選択されたとき

                        // TODO:合法手かどうか判定したい。

                        if (Okiba.ShogiBan == Util_Masu.Masu_ToOkiba(btnSasitaiMasu.Zahyo))                //>>>>> 将棋盤:升目   <移動先など>
                        {
                            //------------------------------
                            // 成る/成らない
                            //------------------------------
                            //
                            //      盤上の、不成の駒で、 / 相手陣に入るものか、相手陣から出てくる駒 ※先手・後手区別なし
                            //
                            RO_Star_Koma koma = Util_Koma.AsKoma(tumandeiruLight.Now);

                            if (
                                Okiba.ShogiBan == Util_Masu.Masu_ToOkiba(koma.Masu) && Util_Sky.IsNareruKoma(tumandeiruLight)
                                &&
                                (
                                    Util_Masu.InAitejin(btnSasitaiMasu.Zahyo, Util_InServer.CurPside(shogiGui))
                                    ||
                                    Util_Sky.InAitejin(tumandeiruLight)
                                )
                                )
                            {
                                // 成るか/成らないか ダイアログボックスを表示します。
                                shogiGui.Shape_PnlTaikyoku.Request_NaruDialogToShow(true);
                            }


                            if (shogiGui.Shape_PnlTaikyoku.Requested_NaruDialogToShow)
                            {
                                // 成る/成らないボタン表示
                                shogiGui.Shape_PnlTaikyoku.GetWidget("BtnNaru").Visible    = true;
                                shogiGui.Shape_PnlTaikyoku.GetWidget("BtnNaranai").Visible = true;
                                shogiGui.Shape_PnlTaikyoku.SetNaruMasu(btnSasitaiMasu);
                                nextPhaseB = SceneName.SceneB_3ErabuNaruNaranai;
                            }
                            else
                            {
                                shogiGui.Shape_PnlTaikyoku.GetWidget("BtnNaru").Visible    = false;
                                shogiGui.Shape_PnlTaikyoku.GetWidget("BtnNaranai").Visible = false;

                                // 駒を動かします。
                                {
                                    // GuiからServerへ渡す情報
                                    PieceType syurui;
                                    Starlight dst;
                                    Util_InGui.Komamove1a_49Gui(out syurui, out dst, btnTumandeiruKoma, btnSasitaiMasu, shogiGui);

                                    // ServerからGuiへ渡す情報
                                    bool         torareruKomaAri;
                                    RO_Star_Koma koma_Food_after;
                                    Util_InServer.Komamove1a_50Srv(out torareruKomaAri, out koma_Food_after, dst, btnTumandeiruKoma.Koma, Util_Koma.AsKoma(dst.Now), shogiGui);

                                    Util_InGui.Komamove1a_51Gui(torareruKomaAri, koma_Food_after, shogiGui);
                                }

                                nextPhaseB = SceneName.SceneB_1TumamitaiKoma;
                            }

                            shogiGui.ResponseData.ToRedraw();
                        }
                        else if ((Okiba.Sente_Komadai | Okiba.Gote_Komadai).HasFlag(
                                     Util_Masu.GetOkiba(btnSasitaiMasu.Zahyo)))       //>>>>> 駒置き:升目
                        {
                            //System.C onsole.WriteLine("駒台上");

                            RO_Star_Koma koma = Util_Koma.AsKoma(shogiGui.GameViewModel.GuiSkyConst.StarlightIndexOf(btnTumandeiruKoma.Koma).Now);

                            SkyBuffer buffer_Sky = new SkyBuffer(shogiGui.GameViewModel.GuiSkyConst);
                            buffer_Sky.AddOverwriteStarlight(btnTumandeiruKoma.Koma, new RO_MotionlessStarlight(
                                                                 //btnTumandeiruKoma.Koma,
                                                                 new RO_Star_Koma(Converter04.Okiba_ToPside(Util_Masu.GetOkiba(btnSasitaiMasu.Zahyo)),// 先手の駒置きに駒を置けば、先手の向きに揃えます。
                                                                                  btnSasitaiMasu.Zahyo,
                                                                                  KomaSyurui14Array.NarazuCaseHandle(Haiyaku184Array.Syurui(koma.Haiyaku)))
                                                                 ));
                            shogiGui.GameViewModel.SetGuiSky(new SkyConst(buffer_Sky));

                            nextPhaseB = SceneName.SceneB_1TumamitaiKoma;

                            shogiGui.ResponseData.RedrawStarlights();                // 駒の再描画要求
                            shogiGui.ResponseData.ToRedraw();
                        }


gt_nextBlock:

                        //----------
                        // 既に選択されている駒
                        //----------
                        Shape_BtnKoma btnKoma_Selected = shogiGui.Shape_PnlTaikyoku.Btn_TumandeiruKoma(shogiGui);



                        //----------
                        // 初期配置ボタン
                        //----------

                        {
                            foreach (UserWidget widget in shogiGui.Shape_PnlTaikyoku.Widgets.Values)
                            {
                                if (widget.HitByMouse(eventState.MouseLocation.X, eventState.MouseLocation.Y))
                                {
                                    if (null != widget.Delegate_MouseHitEvent)
                                    {
                                        widget.Delegate_MouseHitEvent(
                                            shogiGui
                                            , btnKoma_Selected
                                            );
                                    }
                                }
                            }
                        }


                        shogiGui.SetScene(nextPhaseB);

                        //------------------------------
                        // このメインパネルの反応
                        //------------------------------
                        shogiGui.Response("MouseOperation");
                        #endregion
                    }
                    break;

                    case MouseEventStateName.MouseRightButtonDown:
                    {
                        #region マウス右ボタンダウン
                        // 各駒の、移動済フラグを解除
                        //System.C onsole.WriteLine("つまんでいる駒を放します。(5)");
                        shogiGui.Shape_PnlTaikyoku.SetFigTumandeiruKoma(-1);
                        shogiGui.Shape_PnlTaikyoku.SelectFirstTouch = false;

                        //------------------------------
                        // 状態を戻します。
                        //------------------------------
                        shogiGui.SetScene(SceneName.SceneB_1TumamitaiKoma);

                        //------------------------------
                        // このメインパネルの反応
                        //------------------------------
                        shogiGui.Response("MouseOperation");
                        #endregion
                    }
                    break;
                    }
                    #endregion
                }
                break;

                case SceneName.SceneB_3ErabuNaruNaranai:
                {
                    #region 成る成らない

                    switch (eventState.Name2)
                    {
                    case MouseEventStateName.MouseLeftButtonDown:
                    {
                        #region マウス左ボタンダウン
                        SceneName nextPhaseB = SceneName.Ignore;
                        //GuiSky この関数の途中で変更される。ローカル変数に入れているものは古くなる。

                        //----------
                        // 既に選択されている駒
                        //----------
                        Shape_BtnKoma btnKoma_Selected = shogiGui.Shape_PnlTaikyoku.Btn_TumandeiruKoma(shogiGui);

                        string[] buttonNames = new string[] {
                            "BtnNaru",            // [成る]ボタン
                            "BtnNaranai"          // [成らない]ボタン
                        };
                        foreach (string buttonName in buttonNames)
                        {
                            UserWidget widget = shogiGui.Shape_PnlTaikyoku.GetWidget(buttonName);

                            if (widget.HitByMouse(eventState.MouseLocation.X, eventState.MouseLocation.Y))
                            {
                                if (null != widget.Delegate_MouseHitEvent)
                                {
                                    widget.Delegate_MouseHitEvent(
                                        shogiGui
                                        , btnKoma_Selected
                                        );
                                }
                            }
                        }


                        //



                        //----------
                        // 既に選択されている駒
                        //----------
                        //Shape_BtnKomaImpl btnKoma_Selected = shogiGui.Shape_PnlTaikyoku.Btn_TumandeiruKoma(shogiGui);



                        //----------
                        // 初期配置ボタン
                        //----------

                        {
                            foreach (UserWidget widget in shogiGui.Shape_PnlTaikyoku.Widgets.Values)
                            {
                                if (widget.HitByMouse(eventState.MouseLocation.X, eventState.MouseLocation.Y))
                                {
                                    if (null != widget.Delegate_MouseHitEvent)
                                    {
                                        widget.Delegate_MouseHitEvent(
                                            shogiGui
                                            , btnKoma_Selected
                                            );
                                    }
                                }
                            }
                        }


                        shogiGui.SetScene(nextPhaseB);

                        //------------------------------
                        // このメインパネルの反応
                        //------------------------------
                        shogiGui.Response("MouseOperation");
                        #endregion
                    }
                    break;
                    }
                    #endregion
                }
                break;
                }
            }



            //gt_EndMethod1:
            //    ;
        }
コード例 #9
0
 public void SetWidget(string name, UserWidget widget)
 {
     this.Widgets[name] = widget;
 }
コード例 #10
0
 public UserWidgetView(string path, UserWidget userWidget) : base(path)
 {
     view = userWidget.View;
 }
コード例 #11
0
        /// <summary>
        /// イベントの設定。
        /// </summary>
        /// <param name="obj_shogiGui"></param>
        public virtual void Step3_SetEvent(object obj_shogiGui)
        {
            MainGui_Csharp shogibanGui1 = (MainGui_Csharp)obj_shogiGui;

            //----------
            // [成る]ボタン
            //----------
            {
                UserWidget widget = shogibanGui1.GetWidget("BtnNaru");
                widget.Delegate_MouseHitEvent = Event_CsharpImpl.GetInstance().Delegate_BtnNaru;
            }

            //----------
            // [成らない]ボタン
            //----------
            {
                UserWidget widget = shogibanGui1.GetWidget("BtnNaranai");
                widget.Delegate_MouseHitEvent = Event_CsharpImpl.GetInstance().Delegate_BtnNaranai;
            }

            //----------
            // [クリアー]ボタン
            //----------
            {
                UserWidget widget = shogibanGui1.GetWidget("BtnClear");
                widget.Delegate_MouseHitEvent = Event_CsharpImpl.GetInstance().Delegate_BtnClear;
            }

            //----------
            // [再生]ボタン
            //----------
            {
                UserWidget widget = shogibanGui1.GetWidget("BtnPlay");
                widget.Delegate_MouseHitEvent = Event_CsharpImpl.GetInstance().Delegate_BtnPlay;
            }

            //----------
            // [コマ送り]ボタン
            //----------
            {
                UserWidget widget = shogibanGui1.GetWidget("BtnForward");
                widget.Delegate_MouseHitEvent = Event_CsharpImpl.GetInstance().Delegate_BtnForward;
            }

            //----------
            // [巻戻し]ボタン
            //----------
            {
                UserWidget widget = shogibanGui1.GetWidget("BtnBackward");
                widget.Delegate_MouseHitEvent = Event_CsharpImpl.GetInstance().Delegate_BtnBackward;
            }

            //----------
            // ログ出せボタン
            //----------
            {
                UserWidget widget = shogibanGui1.GetWidget("BtnLogdase");
                widget.Delegate_MouseHitEvent = Event_CsharpImpl.GetInstance().Delegate_BtnLogdase;
            }

            //----------
            // [壁置く]ボタン
            //----------
            {
                UserWidget widget = shogibanGui1.GetWidget("BtnKabeOku");
                widget.Delegate_MouseHitEvent = Event_CsharpImpl.GetInstance().Delegate_BtnKabeOku;
            }

            //----------
            // [出力切替]ボタン
            //----------
            {
                UserWidget widget = shogibanGui1.GetWidget("BtnSyuturyokuKirikae");
                widget.Delegate_MouseHitEvent = Event_CsharpImpl.GetInstance().Delegate_BtnSyuturyokuKirikae;
            }

            //----------
            // [▲]~[打]符号ボタン
            //----------
            {
                string[] buttonNames = new string[] {
                    "BtnFugo_Sente"    // [▲]~[打]符号ボタン
                    , "BtnFugo_Gote"
                    , "BtnFugo_1"
                    , "BtnFugo_2"
                    , "BtnFugo_3"
                    , "BtnFugo_4"
                    , "BtnFugo_5"
                    , "BtnFugo_6"
                    , "BtnFugo_7"
                    , "BtnFugo_8"
                    , "BtnFugo_9"
                    , "BtnFugo_Dou"
                    , "BtnFugo_Fu"
                    , "BtnFugo_Hisya"
                    , "BtnFugo_Kaku"
                    , "BtnFugo_Kyo"
                    , "BtnFugo_Kei"
                    , "BtnFugo_Gin"
                    , "BtnFugo_Kin"
                    , "BtnFugo_Oh"
                    , "BtnFugo_Gyoku"
                    , "BtnFugo_Tokin"
                    , "BtnFugo_Narikyo"
                    , "BtnFugo_Narikei"
                    , "BtnFugo_Narigin"
                    , "BtnFugo_Ryu"
                    , "BtnFugo_Uma"
                    , "BtnFugo_Yoru"
                    , "BtnFugo_Hiku"
                    , "BtnFugo_Agaru"
                    , "BtnFugo_Migi"
                    , "BtnFugo_Hidari"
                    , "BtnFugo_Sugu"
                    , "BtnFugo_Nari"
                    , "BtnFugo_Funari"
                    , "BtnFugo_Da"
                };

                foreach (string buttonName in buttonNames)
                {
                    UserWidget widget = shogibanGui1.GetWidget(buttonName);
                    widget.Delegate_MouseHitEvent = Event_CsharpImpl.GetInstance().Delegate_BtnKakusyuFugo;
                }
            }

            //----------
            // [全消]ボタン
            //----------
            {
                UserWidget widget = shogibanGui1.GetWidget("BtnFugo_Zenkesi");
                widget.Delegate_MouseHitEvent = Event_CsharpImpl.GetInstance().Delegate_BtnZenkesi;
            }

            //----------
            // [ここから採譜]ボタン
            //----------
            {
                UserWidget widget = shogibanGui1.GetWidget("BtnFugo_KokokaraSaifu");
                widget.Delegate_MouseHitEvent = Event_CsharpImpl.GetInstance().Delegate_BtnKokokaraSaifu;
            }

            //----------
            // 初期配置ボタン
            //----------
            {
                UserWidget widget = shogibanGui1.GetWidget("BtnSyokihaichi");
                widget.Delegate_MouseHitEvent = Event_CsharpImpl.GetInstance().Delegate_BtnSyokihaichi;
            }

            //----------
            // [向き]ボタン
            //----------
            {
                UserWidget widget = shogibanGui1.GetWidget("BtnMuki");
                widget.Delegate_MouseHitEvent = Event_CsharpImpl.GetInstance().Delegate_BtnMuki;
            }
        }
コード例 #12
0
ファイル: DynamicEntryBox.cs プロジェクト: jcoder58/Plugins
 ///<summary>Remove Entry</summary>
 public void RemoveEntry(UserWidget EntryWidget) =>
 DynamicEntryBox_methods.RemoveEntry_method.Invoke(ObjPointer, EntryWidget);
コード例 #13
0
        /// <summary>
        /// シングルトン。
        /// </summary>
        /// <returns></returns>
        public static Event_CsharpImpl GetInstance()
        {
            if (null == Event_CsharpImpl.instance)
            {
                Event_CsharpImpl ins = new Event_CsharpImpl();
                Event_CsharpImpl.instance = ins;

                //
                // [成る]ボタンのイベント。
                //
                ins.delegate_BtnNaru = (
                    object obj_shogiGui2
                    , object userWidget2 // UerWidget
                    , object btnKoma_Selected2
                    ) =>
                {
                    Shape_BtnKoma  btnKoma_Selected = (Shape_BtnKoma)btnKoma_Selected2;
                    MainGui_Csharp shogibanGui2     = (MainGui_Csharp)obj_shogiGui2;

                    shogibanGui2.SetNaruFlag(true);
                    ins.After_NaruNaranai_ButtonPushed(
                        shogibanGui2
                        , btnKoma_Selected
                        );
                };

                //
                // [成らない]ボタンのイベント。
                //
                ins.delegate_BtnNaranai = (
                    object obj_shogiGui2
                    , object userWidget2 // UerWidget
                    , object btnKoma_Selected2
                    ) =>
                {
                    Shape_BtnKoma  btnKoma_Selected = (Shape_BtnKoma)btnKoma_Selected2;
                    MainGui_Csharp shogibanGui2     = (MainGui_Csharp)obj_shogiGui2;

                    shogibanGui2.SetNaruFlag(false);
                    ins.After_NaruNaranai_ButtonPushed(
                        shogibanGui2
                        , btnKoma_Selected
                        );
                };

                //
                // [クリアー]ボタンのイベント。
                //
                ins.delegate_BtnClear = (
                    object obj_shogiGui2
                    , object userWidget2 // UerWidget
                    , object btnKoma_Selected2
                    ) =>
                {
                    Shape_BtnKoma  btnKoma_Selected = (Shape_BtnKoma)btnKoma_Selected2;
                    MainGui_Csharp shogibanGui2     = (MainGui_Csharp)obj_shogiGui2;

                    Util_Lua_Csharp.ShogiGui = shogibanGui2;
                    Util_Lua_Csharp.Perform("click_clearButton");
                };

                //
                // [再生]ボタンのイベント。
                //
                ins.delegate_BtnPlay = (
                    object obj_shogiGui2
                    , object userWidget2 // UerWidget
                    , object btnKoma_Selected2
                    ) =>
                {
                    Shape_BtnKoma  btnKoma_Selected = (Shape_BtnKoma)btnKoma_Selected2;
                    MainGui_Csharp shogibanGui2     = (MainGui_Csharp)obj_shogiGui2;

                    Util_Lua_Csharp.ShogiGui = shogibanGui2;
                    Util_Lua_Csharp.Perform("click_playButton");
                };

                //
                // [コマ送り]ボタンのイベント。
                //
                ins.delegate_BtnForward = (
                    object obj_shogiGui2
                    , object userWidget2 // UerWidget
                    , object btnKoma_Selected2
                    ) =>
                {
                    Shape_BtnKoma  btnKoma_Selected = (Shape_BtnKoma)btnKoma_Selected2;
                    MainGui_Csharp mainGui3         = (MainGui_Csharp)obj_shogiGui2;

                    string restText = Util_Function_Csharp.ReadLine_FromTextbox();
                    Util_Functions_Server.Komaokuri_Srv(
                        ref restText,
                        mainGui3.Link_Server.Model_Taikyoku,
                        mainGui3.Model_Manual);
                    Util_Function_Csharp.Komaokuri_Gui(restText, mainGui3);
                    Util_Menace.Menace(mainGui3);// メナス
                };

                //
                // [巻き戻し]ボタンのイベント。
                //
                ins.delegate_BtnBackward = (
                    object obj_shogiGui2
                    , object userWidget2 // UerWidget
                    , object btnKoma_Selected2
                    ) =>
                {
                    Shape_BtnKoma  btnKoma_Selected = (Shape_BtnKoma)btnKoma_Selected2;
                    MainGui_Csharp shogibanGui2     = (MainGui_Csharp)obj_shogiGui2;

                    Finger movedKoma;
                    Finger foodKoma;//取られた駒
                    string fugoJStr;

                    if (!Util_Functions_Server.Makimodosi_Srv(out movedKoma, out foodKoma, out fugoJStr, shogibanGui2.Link_Server.Model_Taikyoku))
                    {
                        goto gt_EndBlock;
                    }

                    Util_Function_Csharp.Makimodosi_Gui(shogibanGui2, movedKoma, foodKoma, fugoJStr, Util_Function_Csharp.ReadLine_FromTextbox());
                    Util_Menace.Menace(shogibanGui2);//メナス

gt_EndBlock:
                    ;
                };

                //
                // [ログ出せ]ボタンのイベント。
                //
                ins.delegate_BtnLogdase = (
                    object obj_shogiGui2
                    , object userWidget2 // UerWidget
                    , object btnKoma_Selected2
                    ) =>
                {
                    MainGui_Csharp shogibanGui2     = (MainGui_Csharp)obj_shogiGui2;
                    Shape_BtnKoma  btnKoma_Selected = (Shape_BtnKoma)btnKoma_Selected2;

                    shogibanGui2.Logdase();
                };

                //
                // [壁置く]ボタンのイベント。
                //
                ins.delegate_BtnKabeOku = (
                    object obj_shogiGui2
                    , object userWidget2 // UerWidget
                    , object btnKoma_Selected2
                    ) =>
                {
                    MainGui_Csharp shogibanGui2     = (MainGui_Csharp)obj_shogiGui2;
                    Shape_BtnKoma  btnKoma_Selected = (Shape_BtnKoma)btnKoma_Selected2;
                    UserWidget     widget           = shogibanGui2.GetWidget("BtnKabeOku");

                    // [壁置く]←→[駒動かす]切替
                    switch (widget.Text)
                    {
                    case "壁置く":
                        widget.Text = "駒動かす";
                        break;

                    default:
                        widget.Text = "壁置く";
                        break;
                    }

                    shogibanGui2.RepaintRequest.SetFlag_RefreshRequest();
                };

                //
                // [出力切替]ボタンのイベント。
                //
                ins.delegate_BtnSyuturyokuKirikae = (
                    object obj_shogiGui2
                    , object userWidget2 // UerWidget
                    , object btnKoma_Selected2
                    ) =>
                {
                    Shape_BtnKoma  btnKoma_Selected = (Shape_BtnKoma)btnKoma_Selected2;
                    MainGui_Csharp shogibanGui2     = (MainGui_Csharp)obj_shogiGui2;

                    switch (shogibanGui2.SyuturyokuKirikae)
                    {
                    case SyuturyokuKirikae.Japanese:
                        shogibanGui2.SetSyuturyokuKirikae(SyuturyokuKirikae.Sfen);
                        break;

                    case SyuturyokuKirikae.Sfen:
                        shogibanGui2.SetSyuturyokuKirikae(SyuturyokuKirikae.Html);
                        break;

                    case SyuturyokuKirikae.Html:
                        shogibanGui2.SetSyuturyokuKirikae(SyuturyokuKirikae.Japanese);
                        break;
                    }

                    shogibanGui2.RepaintRequest.SyuturyokuRequest = RepaintRequestGedanTxt.Kifu;
                };

                //
                // [各種符号]ボタンのイベント。
                //
                ins.delegate_BtnKakusyuFugo = (
                    object obj_shogiGui2
                    , object userWidget2     // UerWidget
                    , object btnKoma_Selected2
                    ) =>
                {
                    Shape_BtnKoma  btnKoma_Selected = (Shape_BtnKoma)btnKoma_Selected2;
                    UserWidget     userWidget       = (UserWidget)userWidget2;
                    MainGui_Csharp shogibanGui2     = (MainGui_Csharp)obj_shogiGui2;
                    UserWidget     widget           = shogibanGui2.GetWidget(userWidget.Name);

                    shogibanGui2.RepaintRequest.SetNyuryokuTextTail(widget.Fugo);
                };

                //
                // [全消]ボタンのイベント。
                //
                ins.delegate_BtnZenkesi = (
                    object obj_shogiGui2
                    , object userWidget2 // UerWidget
                    , object btnKoma_Selected2
                    ) =>
                {
                    Shape_BtnKoma  btnKoma_Selected = (Shape_BtnKoma)btnKoma_Selected2;
                    MainGui_Csharp shogibanGui2     = (MainGui_Csharp)obj_shogiGui2;

                    shogibanGui2.RepaintRequest.NyuryokuText = "";
                };

                //
                // [ここから採譜]ボタンのイベント。
                //
                ins.delegate_BtnKokokaraSaifu = (
                    object obj_shogiGui2
                    , object userWidget2 // UerWidget
                    , object btnKoma_Selected2
                    ) =>
                {
                    Shape_BtnKoma  btnKoma_Selected = (Shape_BtnKoma)btnKoma_Selected2;
                    MainGui_Csharp shogibanGui2     = (MainGui_Csharp)obj_shogiGui2;

                    UtilKifuTree282.SetStartpos_KokokaraSaifu(shogibanGui2.Link_Server.Model_Taikyoku.Kifu, shogibanGui2.Link_Server.Model_Taikyoku.Kifu.CurNode.Value.KyokumenConst.KaisiPside);
                    shogibanGui2.RepaintRequest.SyuturyokuRequest = RepaintRequestGedanTxt.Kifu;
                };

                //
                // [初期配置]ボタンのイベント。
                //
                ins.delegate_BtnSyokihaichi = (
                    object obj_shogiGui2
                    , object userWidget2 // UerWidget
                    , object btnKoma_Selected2
                    ) =>
                {
                    Shape_BtnKoma  btnKoma_Selected = (Shape_BtnKoma)btnKoma_Selected2;
                    MainGui_Csharp shogibanGui2     = (MainGui_Csharp)obj_shogiGui2;

                    Util_Function_Csharp.Perform_SyokiHaichi(shogibanGui2);
                };

                //
                // [向き]ボタンのイベント。
                //
                ins.delegate_BtnMuki = (
                    object obj_shogiGui2
                    , object userWidget2 // UerWidget
                    , object btnKoma_Selected2
                    ) =>
                {
                    Shape_BtnKoma  btnKoma_Selected = (Shape_BtnKoma)btnKoma_Selected2;
                    MainGui_Csharp mainGui3         = (MainGui_Csharp)obj_shogiGui2;

                    Shape_BtnKoma movedKoma = mainGui3.Shape_PnlTaikyoku.Btn_MovedKoma();

                    RO_Star koma;
                    Finger  figKoma = Fingers.Error_1;

                    if (null != movedKoma)
                    {
                        //>>>>> 移動直後の駒があるとき
                        koma    = Util_Starlightable.AsKoma(mainGui3.Model_Manual.GuiSkyConst.StarlightIndexOf(movedKoma.Finger).Now);
                        figKoma = movedKoma.Finger;
                    }
                    else if (null != btnKoma_Selected)
                    {
                        //>>>>> 選択されている駒があるとき
                        koma    = Util_Starlightable.AsKoma(mainGui3.Model_Manual.GuiSkyConst.StarlightIndexOf(btnKoma_Selected.Koma).Now);
                        figKoma = btnKoma_Selected.Koma;
                    }
                    else
                    {
                        koma = null;
                    }

                    if (null != koma)
                    {
                        KifuNode modifyNode = new KifuNodeImpl(
                            mainGui3.Link_Server.Model_Taikyoku.Kifu.CurNode.Key,//現在の局面を流用
                            new KyokumenWrapper(
                                SkyConst.NewInstance_OverwriteOrAdd_Light(
                                    mainGui3.Model_Manual.GuiSkyConst,
                                    -1,//そのまま
                                    figKoma,
                                    new RO_Starlight(
                                        new RO_Star(
                                            Conv_Playerside.Reverse(koma.Pside),//向きを逆さにします。
                                            koma.Masu,
                                            koma.Komasyurui
                                            )
                                        )
                                    )
                                )
                            );
                        // ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
                        // ここで局面データを変更します。
                        // ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
                        string jsaFugoStr;
                        Util_Functions_Server.SetCurNode_Srv(
                            mainGui3.Link_Server.Model_Taikyoku,
                            mainGui3.Model_Manual,
                            modifyNode, out jsaFugoStr);
                        mainGui3.RepaintRequest.SetFlag_RefreshRequest();
                    }
                };
            }
            return(Event_CsharpImpl.instance);
        }