//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; }
//Clone a Copy Method. public void Clone(ref DrawSoldier AA//, ref AllDraw. THIS ) { //long Time = TimeElapced.TimeNow();Spaces++; int[,] Tab = new int[8, 8]; for (var i = 0; i < 8; i++) { for (var 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(CurrentAStarGredyMax, MovementsAStarGreedyHeuristicFoundT, IgnoreSelfObjectsT, UsePenaltyRegardMechnisamT, BestMovmentsT, PredictHeuristicT, OnlySelfT, AStarGreedyHeuristicT, ArrangmentsChanged, this.Row, this.Column, this.color, CloneATable(Tab), this.Order, false, this.Current ); AA.ArrangmentsChanged = ArrangmentsChanged; for (var i = 0; i < AllDraw.SodierMovments; i++) { AA.SoldierThinking[i] = new ThinkingChess(i, 1, CurrentAStarGredyMax, MovementsAStarGreedyHeuristicFoundT, IgnoreSelfObjectsT, UsePenaltyRegardMechnisamT, BestMovmentsT, PredictHeuristicT, OnlySelfT, AStarGreedyHeuristicT, ArrangmentsChanged, (int)this.Row, (int)this.Column); this.SoldierThinking[i].Clone(ref AA.SoldierThinking[i]); } AA.Table = new int[8, 8]; for (var ii = 0; ii < 8; ii++) { for (var jj = 0; jj < 8; jj++) { AA.Table[ii, jj] = Tab[ii, jj]; } } AA.Row = Row; AA.Column = Column; AA.Order = Order; AA.Current = Current; AA.color = color; ////{ //AllDraw.OutPut.Append("\r\n");for (int l = 0; l < Spaces; l++) //AllDraw.OutPut.Append(Space); //AllDraw.OutPut.Append("Clone:" + (TimeElapced.TimeNow() - Time).ToString());}Spaces--; }