Beispiel #1
0
        /// <summary>
        /// シングルトン。
        /// </summary>
        /// <returns></returns>
        public static Event_CsharpVsImpl GetInstance()
        {
            if (null == Event_CsharpVsImpl.instance)
            {
                Event_CsharpVsImpl ins = new Event_CsharpVsImpl();
                Event_CsharpVsImpl.instance = ins;

                //
                // [将棋エンジン起動ボタン_学習]ボタンのイベント。
                //
                ins.delegate_BtnShogiEngineKidoL = (
                    object obj_shogiGui2
                    , object userWidget2 // UerWidget
                    , object btnKoma_Selected2
                    ) =>
                {
                    Shape_BtnKoma btnKoma_Selected = (Shape_BtnKoma)btnKoma_Selected2;
                    // ここに処理を書く
                };

                //
                // [将棋エンジン起動ボタン_直観]ボタンのイベント。
                //
                ins.delegate_BtnShogiEngineKidoF = (
                    object obj_shogiGui2
                    , object userWidget2 // UerWidget
                    , object btnKoma_Selected2
                    ) =>
                {
                    Shape_BtnKoma    btnKoma_Selected = (Shape_BtnKoma)btnKoma_Selected2;
                    MainGui_Csharp   shogiGui         = (MainGui_Csharp)obj_shogiGui2;
                    Uc_Form1Mainable ui_PnlMain       = ((Form1_Shogi)shogiGui.OwnerForm).Uc_Form1Main;

                    ui_PnlMain.MainGui.Start_ShogiEngine(ui_PnlMain.SetteiXmlFile.ShogiEngineFilePath);
                };

                //
                // [将棋エンジン起動ボタン_思考]ボタンのイベント。
                //
                ins.delegate_BtnShogiEngineKidoT = (
                    object obj_shogiGui2
                    , object userWidget2 // UerWidget
                    , object btnKoma_Selected2
                    ) =>
                {
                    Shape_BtnKoma btnKoma_Selected = (Shape_BtnKoma)btnKoma_Selected2;
                    // ここに処理を書く

                    MainGui_Csharp   shogiGui   = (MainGui_Csharp)obj_shogiGui2;
                    Uc_Form1Mainable ui_PnlMain = ((Form1_Shogi)shogiGui.OwnerForm).Uc_Form1Main;

                    ui_PnlMain.MainGui.Do_ComputerSente();
                };
            }
            return(Event_CsharpVsImpl.instance);
        }
Beispiel #2
0
        public void Response(string mutexString)
        {
            Uc_Form1Mainable uc_Form1Main = ((Form1_Shogiable)this.OwnerForm).Uc_Form1Main;

            // enum型
            Form1_Mutex mutex2;

            switch (mutexString)
            {
            case "Timer": mutex2 = Form1_Mutex.Timer; break;

            case "MouseOperation": mutex2 = Form1_Mutex.MouseOperation; break;

            case "Saisei": mutex2 = Form1_Mutex.Saisei; break;

            case "Launch": mutex2 = Form1_Mutex.Launch; break;

            default: mutex2 = Form1_Mutex.Empty; break;
            }


            switch (uc_Form1Main.MutexOwner)
            {
            case Form1_Mutex.Launch:       // 他全部無視
                goto gt_EndMethod;

            case Form1_Mutex.Saisei:       // マウスとタイマーは無視
                switch (mutex2)
                {
                case Form1_Mutex.MouseOperation:
                case Form1_Mutex.Timer:
                    goto gt_EndMethod;
                }
                break;

            case Form1_Mutex.MouseOperation:
            case Form1_Mutex.Timer:       // タイマーは無視
                switch (mutex2)
                {
                case Form1_Mutex.Timer:
                    goto gt_EndMethod;
                }
                break;

            default: break;
            }

            uc_Form1Main.Solute_RepaintRequest(mutex2, this);// 再描画

gt_EndMethod:
            ;
        }