private QuartoNode Clone() { QuartoNode clone = new QuartoNode(); clone.pieceToPlace = this.pieceToPlace; clone.unusedPieces = new List<Piece>(this.unusedPieces); clone.unusedTiles = new List<byte>(this.unusedTiles); clone.tiles = new Piece[this.tiles.Length]; this.tiles.CopyTo(clone.tiles, 0); return clone; }
static QuartoNode() { InitialNode = new QuartoNode(); InitialNode.pieceToPlace = 0; InitialNode.unusedPieces = new List<Piece>((IEnumerable<Piece>)Enum.GetValues(typeof(Piece))); InitialNode.unusedTiles = new List<byte>(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }); InitialNode.tiles = new Piece[16]; }