Search in sources :

Example 51 with MinoFactory

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

the class CheckerUsingHoldThreadLocal method initialValue.

@Override
protected Checker<T> initialValue() {
    MinoFactory minoFactory = new MinoFactory();
    PerfectValidator validator = new PerfectValidator();
    return new CheckerUsingHold<>(minoFactory, validator);
}
Also used : CheckerUsingHold(searcher.checker.CheckerUsingHold) MinoFactory(core.mino.MinoFactory) PerfectValidator(searcher.common.validator.PerfectValidator)

Example 52 with MinoFactory

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

the class LockedBuildUpListUpThreadLocal method initialValue.

@Override
protected BuildUpStream initialValue() {
    MinoFactory minoFactory = new MinoFactory();
    MinoShifter minoShifter = new MinoShifter();
    MinoRotation minoRotation = new MinoRotation();
    LockedReachable reachable = new LockedReachable(minoFactory, minoShifter, minoRotation, height);
    return new BuildUpStream(reachable, height);
}
Also used : MinoRotation(core.srs.MinoRotation) MinoFactory(core.mino.MinoFactory) MinoShifter(core.mino.MinoShifter) LockedReachable(core.action.reachable.LockedReachable) BuildUpStream(common.buildup.BuildUpStream)

Example 53 with MinoFactory

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

the class SetupSettingParser method encodeTetfu.

private List<TetfuPage> encodeTetfu(String encoded) throws FinderParseException {
    MinoFactory minoFactory = new MinoFactory();
    ColorConverter colorConverter = new ColorConverter();
    Tetfu tetfu = new Tetfu(minoFactory, colorConverter);
    String data = Tetfu.removePrefixData(encoded);
    if (data == null)
        throw new FinderParseException("Unsupported tetfu: data=" + encoded);
    return tetfu.decode(data);
}
Also used : FinderParseException(exceptions.FinderParseException) ColorConverter(common.tetfu.common.ColorConverter) MinoFactory(core.mino.MinoFactory) Tetfu(common.tetfu.Tetfu)

Example 54 with MinoFactory

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

the class FigUtilSettingParser method encodeTetfu.

private List<TetfuPage> encodeTetfu(String encoded) throws FinderParseException {
    MinoFactory minoFactory = new MinoFactory();
    ColorConverter colorConverter = new ColorConverter();
    Tetfu tetfu = new Tetfu(minoFactory, colorConverter);
    String data = Tetfu.removePrefixData(encoded);
    if (data == null)
        throw new FinderParseException("Unsupported tetfu: data=" + encoded);
    return tetfu.decode(data);
}
Also used : FinderParseException(exceptions.FinderParseException) ColorConverter(common.tetfu.common.ColorConverter) MinoFactory(core.mino.MinoFactory) Tetfu(common.tetfu.Tetfu)

Example 55 with MinoFactory

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

the class OperationWithKeyInterpreter method parseToStream.

public static Stream<MinoOperationWithKey> parseToStream(String operations, MinoFactory minoFactory) {
    return Arrays.stream(operations.split(";")).map(s -> s.split(",")).map(strings -> {
        Piece piece = StringEnumTransform.toPiece(strings[0]);
        Rotate rotate = StringEnumTransform.toRotate(strings[1]);
        Mino mino = minoFactory.create(piece, rotate);
        int x = Integer.valueOf(strings[2]);
        int y = Integer.valueOf(strings[3]);
        long deleteKey = Long.valueOf(strings[4]);
        long usingKey = Long.valueOf(strings[5]);
        return new FullOperationWithKey(mino, x, y, deleteKey, usingKey);
    });
}
Also used : OperationWithKey(common.datastore.OperationWithKey) Piece(core.mino.Piece) Arrays(java.util.Arrays) List(java.util.List) Stream(java.util.stream.Stream) MinoFactory(core.mino.MinoFactory) FullOperationWithKey(common.datastore.FullOperationWithKey) MinoOperationWithKey(common.datastore.MinoOperationWithKey) Rotate(core.srs.Rotate) Collectors(java.util.stream.Collectors) Mino(core.mino.Mino) Rotate(core.srs.Rotate) Piece(core.mino.Piece) Mino(core.mino.Mino) FullOperationWithKey(common.datastore.FullOperationWithKey)

Aggregations

MinoFactory (core.mino.MinoFactory)113 Test (org.junit.jupiter.api.Test)70 MinoShifter (core.mino.MinoShifter)59 LongTest (module.LongTest)51 Field (core.field.Field)45 MinoRotation (core.srs.MinoRotation)40 ColorConverter (common.tetfu.common.ColorConverter)33 Piece (core.mino.Piece)28 Action (common.datastore.action.Action)22 ColumnField (core.column_field.ColumnField)22 Randoms (lib.Randoms)22 InOutPairField (searcher.pack.InOutPairField)21 LockedReachable (core.action.reachable.LockedReachable)17 PerfectValidator (searcher.common.validator.PerfectValidator)17 LockedCandidate (core.action.candidate.LockedCandidate)16 MinoOperationWithKey (common.datastore.MinoOperationWithKey)15 List (java.util.List)15 Collectors (java.util.stream.Collectors)15 PermutationIterable (common.iterable.PermutationIterable)12 LockedReachableThreadLocal (concurrent.LockedReachableThreadLocal)12