use of core.mino.Mino in project solution-finder by knewjade.
the class NeighborTest method getPiece.
@Test
void getPiece() {
OriginalPiece piece = new OriginalPiece(new Mino(Piece.T, Rotate.Spawn), 1, 0, 4);
Neighbor neighbor = new Neighbor(piece);
assertThat(piece).isEqualTo(neighbor.getPiece());
}
use of core.mino.Mino in project solution-finder by knewjade.
the class NeighborTest method getNextLeftRotateSources.
@Test
void getNextLeftRotateSources() {
OriginalPiece piece = new OriginalPiece(new Mino(Piece.T, Rotate.Spawn), 1, 0, 4);
Neighbor neighbor = new Neighbor(piece);
OriginalPieceFactory factory = new OriginalPieceFactory(4);
List<OriginalPiece> pieces = new ArrayList<>(factory.create());
Randoms randoms = new Randoms();
List<Neighbor> samples = randoms.sample(pieces, 4).stream().map(Neighbor::new).collect(Collectors.toList());
neighbor.updateLeftRotateSource(samples);
assertThat(neighbor.getNextLeftRotateSources()).containsAll(samples);
}
use of core.mino.Mino in project solution-finder by knewjade.
the class NeighborTest method getNextRightRotateDestinations.
@Test
void getNextRightRotateDestinations() {
OriginalPiece piece = new OriginalPiece(new Mino(Piece.T, Rotate.Spawn), 1, 0, 4);
Neighbor neighbor = new Neighbor(piece);
OriginalPieceFactory factory = new OriginalPieceFactory(4);
List<OriginalPiece> pieces = new ArrayList<>(factory.create());
Randoms randoms = new Randoms();
List<Neighbor> samples = randoms.sample(pieces, 4).stream().map(Neighbor::new).collect(Collectors.toList());
neighbor.updateRightRotateDestination(samples);
assertThat(neighbor.getNextRightRotateDestinations()).containsAll(samples);
}
use of core.mino.Mino in project solution-finder by knewjade.
the class OriginalPieceTest method testEqualsDiffX.
@Test
void testEqualsDiffX() {
OriginalPiece piece1 = new OriginalPiece(new Mino(Piece.I, Rotate.Spawn), 3, 4, 10);
OriginalPiece piece2 = new OriginalPiece(new Mino(Piece.I, Rotate.Left), 2, 4, 10);
assertThat(piece1.equals(piece2)).isFalse();
}
use of core.mino.Mino in project solution-finder by knewjade.
the class OriginalPieceTest method testHashCodeDiffBlock.
@Test
void testHashCodeDiffBlock() {
OriginalPiece piece1 = new OriginalPiece(new Mino(Piece.I, Rotate.Spawn), 3, 4, 10);
OriginalPiece piece2 = new OriginalPiece(new Mino(Piece.L, Rotate.Spawn), 3, 4, 10);
assertThat(piece1.hashCode()).isNotEqualTo(piece2.hashCode());
}
Aggregations