//Copy constructor public SimpleBoard(SimpleBoard input) { int SizeX = input.OccupationArray.GetLength(0); int SizeY = input.OccupationArray.GetLength(1); Square.occupation_type[,] newOcc = new Square.occupation_type[SizeX, SizeY]; Square.square_type[,] newTypes = new Square.square_type[SizeX, SizeY]; for (int i = 0; i < SizeY; i++) //Rows { for (int j = 0; j < SizeX; j++) //Columns { newOcc[j, i] = input.OccupationArray[j, i]; if (input.OccupationArray[j, i] == Square.occupation_type.King) { this.kingSquare = new SimpleSquare(j, i, Square.occupation_type.King, input.SquareTypeArray[j, i]); } newTypes[j, i] = input.SquareTypeArray[j, i]; } } this.OccupationArray = newOcc; this.SquareTypeArray = newTypes; }
public SimpleSquare(int _column, int _row, Square.occupation_type _occupancy_type, Square.square_type _square_type) { this.Coords = new int[] { _column, _row }; this.Row = _row; this.Column = _column; this.Occupation = _occupancy_type; this.SquareType = _square_type; }