Search in sources :

Example 16 with Mino

use of core.mino.Mino in project solution-finder by knewjade.

the class OriginalPieceTest method testHashCodeDiffX.

@Test
void testHashCodeDiffX() {
    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.hashCode()).isNotEqualTo(piece2.hashCode());
}
Also used : Mino(core.mino.Mino) Test(org.junit.jupiter.api.Test)

Example 17 with Mino

use of core.mino.Mino in project solution-finder by knewjade.

the class OriginalPieceTest method testEqualsDiffRotate.

@Test
void testEqualsDiffRotate() {
    OriginalPiece piece1 = new OriginalPiece(new Mino(Piece.I, Rotate.Spawn), 3, 4, 10);
    OriginalPiece piece2 = new OriginalPiece(new Mino(Piece.I, Rotate.Left), 3, 4, 10);
    assertThat(piece1.equals(piece2)).isFalse();
}
Also used : Mino(core.mino.Mino) Test(org.junit.jupiter.api.Test)

Example 18 with Mino

use of core.mino.Mino in project solution-finder by knewjade.

the class OriginalPieceTest method testHashCode.

@Test
void testHashCode() {
    OriginalPiece piece1 = new OriginalPiece(new Mino(Piece.I, Rotate.Spawn), 3, 4, 10);
    OriginalPiece piece2 = new OriginalPiece(new Mino(Piece.I, Rotate.Spawn), 3, 4, 10);
    assertThat(piece1.hashCode()).isEqualTo(piece2.hashCode());
}
Also used : Mino(core.mino.Mino) Test(org.junit.jupiter.api.Test)

Example 19 with Mino

use of core.mino.Mino in project solution-finder by knewjade.

the class OriginalPieceTest method testHashCodeDiffY.

@Test
void testHashCodeDiffY() {
    OriginalPiece piece1 = new OriginalPiece(new Mino(Piece.I, Rotate.Spawn), 3, 4, 10);
    OriginalPiece piece2 = new OriginalPiece(new Mino(Piece.I, Rotate.Left), 3, 8, 10);
    assertThat(piece1.hashCode()).isNotEqualTo(piece2.hashCode());
}
Also used : Mino(core.mino.Mino) Test(org.junit.jupiter.api.Test)

Example 20 with Mino

use of core.mino.Mino in project solution-finder by knewjade.

the class MinoRotationTest method kicksRight.

private int[] kicksRight(String marks, Mino mino, int x, int y) {
    Field field = FieldFactory.createField(marks);
    assert field.canPut(mino, x, y);
    Mino after = new Mino(mino.getPiece(), mino.getRotate().getRightRotate());
    return minoRotation.getKicksWithRightRotation(field, mino, after, x, y);
}
Also used : Field(core.field.Field) Mino(core.mino.Mino)

Aggregations

Mino (core.mino.Mino)103 Test (org.junit.jupiter.api.Test)46 Rotate (core.srs.Rotate)27 Field (core.field.Field)24 Piece (core.mino.Piece)20 Randoms (lib.Randoms)16 MinoFactory (core.mino.MinoFactory)14 ColorType (common.tetfu.common.ColorType)12 ColoredField (common.tetfu.field.ColoredField)12 ArrayList (java.util.ArrayList)12 FullOperationWithKey (common.datastore.FullOperationWithKey)9 HashSet (java.util.HashSet)9 ColorConverter (common.tetfu.common.ColorConverter)8 OriginalPiece (core.neighbor.OriginalPiece)8 List (java.util.List)8 MinoOperationWithKey (common.datastore.MinoOperationWithKey)7 OperationWithKey (common.datastore.OperationWithKey)7 TetfuPage (common.tetfu.TetfuPage)7 Arrays (java.util.Arrays)7 Collectors (java.util.stream.Collectors)7