Search in sources :

Example 11 with SimpleOperation

use of common.datastore.SimpleOperation in project solution-finder by knewjade.

the class OperationComparatorTest method compareDiffY.

@Test
void compareDiffY() throws Exception {
    SimpleOperation operation1 = new SimpleOperation(Piece.I, Rotate.Spawn, 0, 1);
    Operation operation2 = createNewOperation(Piece.I, Rotate.Spawn, 0, 4);
    // assert is not 0 & sign reversed
    OperationComparator comparator = new OperationComparator();
    assertThat(comparator.compare(operation1, operation2) * comparator.compare(operation2, operation1)).isLessThan(0);
}
Also used : SimpleOperation(common.datastore.SimpleOperation) SimpleOperation(common.datastore.SimpleOperation) Operation(common.datastore.Operation) Test(org.junit.jupiter.api.Test)

Aggregations

SimpleOperation (common.datastore.SimpleOperation)11 Operation (common.datastore.Operation)8 Test (org.junit.jupiter.api.Test)8 Piece (core.mino.Piece)6 Rotate (core.srs.Rotate)5 Randoms (lib.Randoms)2 Operations (common.datastore.Operations)1 Action (common.datastore.action.Action)1 MinimalAction (common.datastore.action.MinimalAction)1 Order (common.datastore.order.Order)1 ArrayList (java.util.ArrayList)1