use of core.mino.MinoFactory in project solution-finder by knewjade.
the class MappedBasicSolutionsTest method createSeparableMinos.
private static SeparableMinos createSeparableMinos(SizedBit sizedBit) {
MinoFactory minoFactory = new MinoFactory();
MinoShifter minoShifter = new MinoShifter();
return SeparableMinos.createSeparableMinos(minoFactory, minoShifter, sizedBit);
}
use of core.mino.MinoFactory in project solution-finder by knewjade.
the class PackSearcherComparingParityBasedOnDemandTest method createSeparableMinos.
private static SeparableMinos createSeparableMinos(SizedBit sizedBit) {
MinoFactory minoFactory = new MinoFactory();
MinoShifter minoShifter = new MinoShifter();
return SeparableMinos.createSeparableMinos(minoFactory, minoShifter, sizedBit);
}
use of core.mino.MinoFactory in project solution-finder by knewjade.
the class PackSearcherComparingParityBasedTest method createSeparableMinos.
private static SeparableMinos createSeparableMinos(SizedBit sizedBit) {
MinoFactory minoFactory = new MinoFactory();
MinoShifter minoShifter = new MinoShifter();
return SeparableMinos.createSeparableMinos(minoFactory, minoShifter, sizedBit);
}
use of core.mino.MinoFactory in project solution-finder by knewjade.
the class CheckerUsingHoldTest method assertResult.
private void assertResult(Field field, int maxClearLine, LockedReachable reachable, List<Piece> blocks) {
Result result = checker.getResult();
// Check blocks is same
List<Piece> resultPieces = parseToBlocks(result);
Piece lastHoldPiece = result.getLastHold();
HashSet<LongPieces> pieces = OrderLookup.reverseBlocks(resultPieces, blocks.size()).stream().map(StackOrder::toStream).map(stream -> stream.map(block -> block != null ? block : lastHoldPiece)).map(LongPieces::new).collect(Collectors.toCollection(HashSet::new));
assertThat(pieces).contains(new LongPieces(blocks));
// Check can build result
Operations operations = parseToOperations(result);
List<MinoOperationWithKey> operationWithKeys = OperationTransform.parseToOperationWithKeys(field, operations, minoFactory, maxClearLine);
boolean cansBuild = BuildUp.cansBuild(field, operationWithKeys, maxClearLine, reachable);
assertThat(cansBuild).isTrue();
}
use of core.mino.MinoFactory in project solution-finder by knewjade.
the class LimitIterationCandidateTest method testSearch2.
@Test
void testSearch2() throws Exception {
MinoFactory minoFactory = new MinoFactory();
MinoShifter minoShifter = new MinoShifter();
MinoRotation minoRotation = new MinoRotation();
Candidate<Action> candidate = new LimitIterationCandidate(minoFactory, minoShifter, minoRotation, 3);
String marks = "" + "XXXX______" + "XXXXX_____" + "X___X_____" + "XX_XX_____";
Field field = FieldFactory.createField(marks);
Set<Action> actions = candidate.search(field, Piece.T, 4);
assertThat(actions.stream().filter((e) -> e.getRotate() == Rotate.Spawn)).hasSize(3);
assertThat(actions.stream().filter((e) -> e.getRotate() == Rotate.Right)).hasSize(4);
assertThat(actions.stream().filter((e) -> e.getRotate() == Rotate.Reverse)).hasSize(4);
assertThat(actions.stream().filter((e) -> e.getRotate() == Rotate.Left)).hasSize(4);
}
Aggregations