コード例 #1
0
ファイル: TakeRoot.cs プロジェクト: tetrashop/UnityRefrigitz
        public bool Save(bool FOUND, bool Quantum, RefrigtzChessPortableForm Curent, ref bool LoadTree, bool MovementsAStarGreedyHeuristicFound, bool IInoreSelfObjects, bool UsePenaltyRegardMechnisam, bool BestMovments, bool PredictHeuristic, bool OnlySelf, bool AStarGreedyHeuristic, bool ArrangmentsChanged)
        {
            Object OO = new Object();

            lock (OO)
            {
                //System.Threading.Thread ttt = new System.Threading.Thread(new System.Threading.ThreadStart(Wait));
                //ttt.Start();
                //ttt.Join();

                /*if (!Quantum)
                 * {
                 *  while (Curent.Draw.AStarGreedyString != null)
                 *      Curent.Draw = Curent.Draw.AStarGreedyString;
                 * }
                 * else
                 * {
                 *  while (Curent.DrawQ.AStarGreedyString != null)
                 *      Curent.DrawQ = Curent.DrawQ.AStarGreedyString;
                 * }
                 * if (UsePenaltyRegardMechnisam && AStarGreedyHeuristic)
                 *  AllDrawKind = 4;
                 * else
                 *                                   if ((!UsePenaltyRegardMechnisam) && AStarGreedyHeuristic)
                 *  AllDrawKind = 3;
                 * if (UsePenaltyRegardMechnisam && (!AStarGreedyHeuristic))
                 *  AllDrawKind = 2;
                 * if ((!UsePenaltyRegardMechnisam) && (!AStarGreedyHeuristic))
                 *  AllDrawKind = 1;
                 * //Set Configuration To True for some unknown reason!.
                 * //UpdateConfigurationTableVal = true;
                 * SetAllDrawKindString();
                 */
                try
                {
                    RefrigtzChessPortable.AllDraw Stote = Curent.Draw;
                    if (!File.Exists(AllDrawKindString))
                    {
#pragma warning disable CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
#pragma warning disable CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
                        GalleryStudio.RefregizMemmory rt = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged
#pragma warning restore CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
#pragma warning restore CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
                                                                                             );
                        //if (!Quantum)
                        {
                            if (Curent.Draw != null)
                            {
                                Curent.Draw             = Curent.RootFound();
                                rt.AllDrawCurrentAccess = Curent.Draw;
                                rt.RewriteAllDraw(RefrigtzChessPortableForm.OrderPlate);
                                RefrigtzChessPortable.AllDraw.DrawTable = false;
                                //.SetBoxText("\r\nSaved Completed.");
                                //Curent.RefreshBoxText();
                                //PictureBoxRefrigtzChessPortable.SendToBack();
                                //PictureBoxTimerGray.SendToBack();
                                //PictureBoxTimerBrown.SendToBack();
                                ////MessageBox.Show("Saved Completed.");
                            }
                        }

                        /*else {
                         *  if (Curent.DrawQ != null)
                         *  {
                         *      Curent.DrawQ = Curent.RootFoundQ();
                         *      rt.AllDrawCurrentAccessQ = Curent.DrawQ;
                         *      rt.RewriteAllDrawQ(RefrigtzChessPortableForm.OrderPlate);
                         *      QuantumRefrigiz.AllDraw.DrawTable = false;
                         * //Curent.SetBoxText("\r\nSaved Completed.");
                         *  //    Curent.RefreshBoxText();
                         *      //PictureBoxRefrigtzChessPortable.SendToBack();
                         *      //PictureBoxTimerGray.SendToBack();
                         *      //PictureBoxTimerBrown.SendToBack();
                         *      ////MessageBox.Show("Saved Completed.");
                         *  }
                         */
                    }
                    else
                    if (File.Exists(AllDrawKindString))
                    {
                        //DrawManagement(FOUND, UsePenaltyRegardMechnisam, AStarGreedyHeuristic);

                        File.Delete(RefrigtzChessPortableForm.AllDrawKindString);
#pragma warning disable CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
#pragma warning disable CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
                        GalleryStudio.RefregizMemmory rt = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged
#pragma warning restore CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
#pragma warning restore CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
                                                                                             );
                        //"Universal Root Founding";
                        if (Curent.Draw != null)
                        {
                            Curent.Draw             = Curent.RootFound();
                            rt.AllDrawCurrentAccess = Curent.Draw;
                            rt.RewriteAllDraw(RefrigtzChessPortableForm.OrderPlate);
                            RefrigtzChessPortable.AllDraw.DrawTable = false;
                            // Curent.SetBoxText("\r\nSaved Completed.");
                            // Curent.RefreshBoxText();
                            //PictureBoxRefrigtzChessPortable.SendToBack();
                            //PictureBoxTimerGray.SendToBack();
                            //PictureBoxTimerBrown.SendToBack();
                            ////MessageBox.Show("Saved Completed.");
                        }
                        //DrawManagement(FOUND, UsePenaltyRegardMechnisam, AStarGreedyHeuristic);
                    }
                    Curent.Draw = Stote;
                    return(true);

#pragma warning disable CS0162 // Unreachable code detected
                    return(true);

#pragma warning restore CS0162 // Unreachable code detected
                }
                catch (Exception t)
                {
                    Log(t);
                    return(false);
                }
            }
        }
コード例 #2
0
        public bool Save(bool FOUND, bool Quantum, RefrigtzChessPortableForm Curent, ref bool LoadTree, bool MovementsAStarGreedyHeuristicFound, bool IInoreSelfobjects, bool UsePenaltyRegardMechnisam, bool BestMovments, bool PredictHeuristic, bool OnlySelf, bool AStarGreedyHeuristic, bool ArrangmentsChanged)
        {
            object OO = new object();

            lock (OO)
            {
                /*if (!Quantum)
                 * {
                 *  while (Curent.Draw.AStarGreedyString != null)
                 *      Curent.Draw = Curent.Draw.AStarGreedyString;
                 * }
                 * else
                 * {
                 *  while (Curent.DrawQ.AStarGreedyString != null)
                 *      Curent.DrawQ = Curent.DrawQ.AStarGreedyString;
                 * }
                 * if (UsePenaltyRegardMechnisam && AStarGreedyHeuristic)
                 *  AllDrawKind = 4;
                 * else
                 *                                   if ((!UsePenaltyRegardMechnisam) && AStarGreedyHeuristic)
                 *  AllDrawKind = 3;
                 * if (UsePenaltyRegardMechnisam && (!AStarGreedyHeuristic))
                 *  AllDrawKind = 2;
                 * if ((!UsePenaltyRegardMechnisam) && (!AStarGreedyHeuristic))
                 *  AllDrawKind = 1;
                 * //Set Configuration To True for some unknown reason!.
                 * //UpdateConfigurationTableVal = true;
                 * SetAllDrawKindString();
                 */
                try
                {
                    if (!DrawManagement(FOUND, UsePenaltyRegardMechnisam, AStarGreedyHeuristic))
                    {
                        return(false);
                    }

                    var ttt = Task.Factory.StartNew(() => Wait(AllDrawKindString));

                    ttt.Wait();

                    RefrigtzChessPortable.AllDraw Stote = Curent.Draw;
                    if (!File.Exists(AllDrawKindString))
                    {
                        GalleryStudio.RefregizMemmory rt = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfobjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged


                                                                                             );
                        //if (!Quantum)
                        {
                            if (Curent.Draw != null)
                            {
                                Curent.Draw             = Curent.RootFound();
                                rt.AllDrawCurrentAccess = Curent.Draw;
                                rt.RewriteAllDraw(RefrigtzChessPortableForm.OrderPlate);
                                RefrigtzChessPortable.AllDraw.DrawTable = false;
                                //.SetBoxText("\r\nSaved Completed.");
                                //Curent.RefreshBoxText();
                                //PictureBoxRefrigtzChessPortable.SendToBack();
                                //PictureBoxTimerGray.SendToBack();
                                //PictureBoxTimerBrown.SendToBack();
                                ////MessageBox.Show("Saved Completed.");
                            }
                        }

                        /*else {
                         *  if (Curent.DrawQ != null)
                         *  {
                         *      Curent.DrawQ = Curent.RootFoundQ();
                         *      rt.AllDrawCurrentAccessQ = Curent.DrawQ;
                         *      rt.RewriteAllDrawQ(RefrigtzChessPortableForm.OrderPlate);
                         *      QuantumRefrigiz.AllDraw.DrawTable = false;
                         * //Curent.SetBoxText("\r\nSaved Completed.");
                         *  //    Curent.RefreshBoxText();
                         *      //PictureBoxRefrigtzChessPortable.SendToBack();
                         *      //PictureBoxTimerGray.SendToBack();
                         *      //PictureBoxTimerBrown.SendToBack();
                         *      ////MessageBox.Show("Saved Completed.");
                         *  }
                         */
                    }
                    else
                    if (File.Exists(AllDrawKindString))
                    {
                        //DrawManagement(FOUND, UsePenaltyRegardMechnisam, AStarGreedyHeuristic);

                        File.Delete(RefrigtzChessPortableForm.AllDrawKindString);


                        GalleryStudio.RefregizMemmory rt = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfobjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged


                                                                                             );
                        //"Universal Root Founding";
                        if (Curent.Draw != null)
                        {
                            Curent.Draw             = Curent.RootFound();
                            rt.AllDrawCurrentAccess = Curent.Draw;
                            rt.RewriteAllDraw(RefrigtzChessPortableForm.OrderPlate);
                            RefrigtzChessPortable.AllDraw.DrawTable = false;
                            // Curent.SetBoxText("\r\nSaved Completed.");
                            // Curent.RefreshBoxText();
                            //PictureBoxRefrigtzChessPortable.SendToBack();
                            //PictureBoxTimerGray.SendToBack();
                            //PictureBoxTimerBrown.SendToBack();
                            ////MessageBox.Show("Saved Completed.");
                        }
                        //DrawManagement(FOUND, UsePenaltyRegardMechnisam, AStarGreedyHeuristic);
                    }
                    Curent.Draw = Stote;
                    return(true);
                }
                catch (Exception t)
                { Log(t);

                  return(false); }
            }
        }
コード例 #3
0
ファイル: TakeRoot.cs プロジェクト: tetrashop/UnityRefrigitz
        public bool Load(bool FOUND, bool Quantum, RefrigtzChessPortableForm Curent, ref bool LoadTree, bool MovementsAStarGreedyHeuristicFound, bool IInoreSelfObjects, bool UsePenaltyRegardMechnisam, bool BestMovments, bool PredictHeuristic, bool OnlySelf, bool AStarGreedyHeuristic, bool ArrangmentsChanged)
        {
            Object OO = new Object();

            lock (OO)
            {
                DrawManagement(FOUND, UsePenaltyRegardMechnisam, AStarGreedyHeuristic);

                bool DrawDrawen = false;
                //Load Middle Targets.
                try
                {
                    if (File.Exists(RefrigtzChessPortableForm.AllDrawKindString))
                    {
                        if (RefrigtzChessPortableForm.MovmentsNumber >= 0)
                        {
                            //if (!Quantum)
                            {
#pragma warning disable CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
#pragma warning disable CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
                                GalleryStudio.RefregizMemmory tr = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged);
#pragma warning restore CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
#pragma warning restore CS0436 // The type 'RefregizMemmory' in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs' conflicts with the imported type 'RefregizMemmory' in 'GalleryStudio, Version=6.0.0.14, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'G:\'Personal'_'Files'\Refregitz\PortableChess\Chess\RefregizMemmory.cs'.
                                t = (RefrigtzChessPortable.AllDraw)tr.Load(Quantum, RefrigtzChessPortableForm.OrderPlate);
                                if (t != null)
                                {
                                    Curent.Draw = t;

                                    LoadTree    = true;
                                    Curent.Draw = Curent.RootFound();

                                    //Curent.Draw.UpdateLoseAndWinDepenOfKind(Curent.Draw.OrderP);


                                    t = Curent.Draw;
                                    //Curent.SetDrawFounding(ref FOUND, ref THIS, false);
                                    DrawDrawen = true;

                                    //System.Windows.Forms.//MessageBox.Show("Load Completed.");
                                }
                            }

                            /*else
                             * {
                             *  GalleryStudio.RefregizMemmory tr = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged);
                             * tt =(QuantumRefrigiz.AllDraw) tr.LoadQ(Quantum, RefrigtzChessPortableForm.OrderPlate);
                             *  if (t != null)
                             *  {
                             *
                             *      Curent.DrawQ = tt;
                             *
                             *      LoadTree = true;
                             *
                             *
                             *      Curent.DrawQ = Curent.RootFoundQ();
                             *
                             *      tt = Curent.DrawQ;
                             *
                             *      DrawDrawen = true;
                             *
                             *      //System.Windows.Forms.//MessageBox.Show("Load Completed.");
                             *  }
                             * }*/
                        }
                        File.Delete(RefrigtzChessPortableForm.AllDrawKindString);
                    }
                }
                catch (Exception t) { Log(t); }
                //System.Threading.Thread ttt = new System.Threading.Thread(new System.Threading.ThreadStart(Wait));
                //ttt.Start();
                //ttt.Join();

                return(DrawDrawen);
            }
        }
コード例 #4
0
        public bool Load(bool FOUND, bool Quantum, RefrigtzChessPortableForm Curent, ref bool LoadTree, bool MovementsAStarGreedyHeuristicFound, bool IInoreSelfobjects, bool UsePenaltyRegardMechnisam, bool BestMovments, bool PredictHeuristic, bool OnlySelf, bool AStarGreedyHeuristic, bool ArrangmentsChanged)
        {
            object OO = new object();

            lock (OO)
            { if (!DrawManagement(FOUND, UsePenaltyRegardMechnisam, AStarGreedyHeuristic))
              {
                  return(false);
              }

              var ttt = Task.Factory.StartNew(() => Wait(AllDrawKindString));

              ttt.Wait();


              bool DrawDrawen = false;
              //Load Middle Targets.
              try
              {
                  if (File.Exists(AllDrawKindString))
                  {
                      if (RefrigtzChessPortableForm.MovmentsNumber >= 0)
                      {
                          //if (!Quantum)
                          {
                              GalleryStudio.RefregizMemmory tr = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfobjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged);


                              t = (RefrigtzChessPortable.AllDraw)tr.Load(Quantum, RefrigtzChessPortableForm.OrderPlate);
                              if (t != null)
                              {
                                  Curent.Draw = t;

                                  LoadTree    = true;
                                  Curent.Draw = Curent.RootFound();

                                  //Curent.Draw.UpdateLoseAndWinDepenOfKind(Curent.Draw.OrderP);


                                  t = Curent.Draw;
                                  //Curent.SetDrawFounding(ref FOUND, ref THIS, false);
                                  DrawDrawen = true;

                                  //System.Windows.Forms.//MessageBox.Show("Load Completed.");
                              }
                          }

                          /*else
                           * {
                           *  GalleryStudio.RefregizMemmory tr = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfobjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged);
                           * tt =(QuantumRefrigiz.AllDraw) tr.LoadQ(Quantum, RefrigtzChessPortableForm.OrderPlate);
                           *  if (t != null)
                           *  {
                           *
                           *      Curent.DrawQ = tt;
                           *
                           *      LoadTree = true;
                           *
                           *
                           *      Curent.DrawQ = Curent.RootFoundQ();
                           *
                           *      tt = Curent.DrawQ;
                           *
                           *      DrawDrawen = true;
                           *
                           *      //System.Windows.Forms.//MessageBox.Show("Load Completed.");
                           *  }
                           * }*/
                      }
                      File.Delete(RefrigtzChessPortableForm.AllDrawKindString);
                  }
              }
              catch (Exception t) { /*Log(t);*/ }
              //System.Threading.Thread ttt = new System.Threading.Thread(new System.Threading.ThreadStart(Wait));
              //ttt.Start();
              //ttt.Join();

              return(DrawDrawen); }
        }