Search in sources :

Example 96 with Mino

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

the class OriginalPieceTest method testEqualsDiffBlock.

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

Example 97 with Mino

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

the class OriginalPieceTest method testEqualsDiffY.

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

Example 98 with Mino

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

the class OriginalPieceTest method testHashCodeDiffRotate.

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

Example 99 with Mino

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

the class OriginalPieceTest method testEquals.

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

Example 100 with Mino

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

the class MinoRotationTest method kicksLeft.

private int[] kicksLeft(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().getLeftRotate());
    return minoRotation.getKicksWithLeftRotation(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