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);
}
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);
}
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);
}
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);
}
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);
});
}
Aggregations