//Base Task Load. void BaseThread() { //Initiate Task. FormRefrigtz ttt = new FormRefrigtz(false); ttt.Sec.ShowDialog(); ttt.ShowDialog(); Process.GetCurrentProcess().Kill(); }
public bool Save(bool FOUND, bool Quantum, FormRefrigtz 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) { try { RefrigtzW.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(FormRefrigtz.OrderPlate); RefrigtzW.AllDraw.DrawTable = false; } } } else if (File.Exists(AllDrawKindString)) { File.Delete(FormRefrigtz.AllDrawKindString); GalleryStudio.RefregizMemmory rt = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged ); if (Curent.Draw != null) { Curent.Draw = Curent.RootFound(); rt.AllDrawCurrentAccess = Curent.Draw; rt.RewriteAllDraw(FormRefrigtz.OrderPlate); RefrigtzW.AllDraw.DrawTable = false; } } 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); } } }
public bool Load(bool FOUND, bool Quantum, FormRefrigtz 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(FormRefrigtz.AllDrawKindString)) { if (FormRefrigtz.MovmentsNumber >= 0) { //if (!Quantum) { GalleryStudio.RefregizMemmory tr = new GalleryStudio.RefregizMemmory(MovementsAStarGreedyHeuristicFound, IInoreSelfObjects, UsePenaltyRegardMechnisam, BestMovments, PredictHeuristic, OnlySelf, AStarGreedyHeuristic, ArrangmentsChanged); t = (RefrigtzW.AllDraw)tr.Load(Quantum, FormRefrigtz.OrderPlate); if (t != null) { Curent.Draw = t; LoadTree = true; Curent.Draw = Curent.RootFound(); Curent.Draw.UpdateLoseAndWinDepenOfKind(FormRefrigtz.OrderPlate); t = Curent.Draw; DrawDrawen = true; } } } File.Delete(FormRefrigtz.AllDrawKindString); } } catch (Exception t) { Log(t); } return(DrawDrawen); } }
//Clone a Copy Method. public void Clone(ref DrawSoldier AA, ref FormRefrigtz THIS ) { int[,] Tab = new int[8, 8]; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { Tab[i, j] = this.Table[i, j]; } } //Initiate a Object and Assignemt of a Clone to Construction of a Copy. AA = new DrawSoldier(MovementsAStarGreedyHuristicFoundT, IgnoreSelfObjectsT, UsePenaltyRegardMechnisamT, BestMovmentsT, PredictHuristicT, OnlySelfT, AStarGreedyHuristicT, ArrangmentsChanged, this.Row, this.Column, this.color, Tab, this.Order, false, this.Current); AA.ArrangmentsChanged = ArrangmentsChanged; for (int i = 0; i < AllDraw.SodierMovments; i++) { try { AA.SoldierThinking[i] = new ThinkingChess(MovementsAStarGreedyHuristicFoundT, IgnoreSelfObjectsT, UsePenaltyRegardMechnisamT, BestMovmentsT, PredictHuristicT, OnlySelfT, AStarGreedyHuristicT, ArrangmentsChanged, (int)this.Row, (int)this.Column); this.SoldierThinking[i].Clone(ref AA.SoldierThinking[i]); } catch (Exception t) { Log(t); AA.SoldierThinking[i] = null; } } AA.Table = new int[8, 8]; for (int ii = 0; ii < 8; ii++) { for (int jj = 0; jj < 8; jj++) { AA.Table[ii, jj] = Tab[ii, jj]; } } AA.RowS = RowS; AA.ColumnS = ColumnS; AA.Order = Order; AA.Current = Current; AA.color = color; }