public ImageJigsawSimpleBezierPiece(BitmapImage imageSource, int col, int row, double pieceSize) : base(imageSource, col, row, pieceSize) { _bezierCurveModel = BezierCurveHelper.FindModel(col, row); if (_bezierCurveModel != null) { base.InitShapeProperties(); this.Position = _bezierCurveModel.Position; } }
public void TestConvertPointWithValidStrings() { const int rows = 4; const int columns = 4; var imaeSource = new BitmapImage(); var pieces = new List <IJigsawPiece>(); for (int row = 0; row < rows; row++) { for (int col = 0; col < columns; col++) { IJigsawPiece jigsawPiece = JigsawPieceFactory.CreateImagePuzzelPiece(imaeSource, col, row, 200, PieceType.SimpleBezier); pieces.Add(jigsawPiece); } } var scrambledPieces = JigsawHelper.ScramblePieces(pieces, rows, columns); foreach (var jigsawPiece in scrambledPieces) { var tempModel = BezierCurveHelper.FindModel(jigsawPiece.CurrentColumn, jigsawPiece.CurrentRow); Assert.AreEqual(jigsawPiece.Position, tempModel.Position); } }