Search in sources :

Example 11 with TetfuElement

use of common.tetfu.TetfuElement in project solution-finder by knewjade.

the class EasyTetfu method encodeUrl.

public String encodeUrl(Field initField, BlockField blockField) {
    Tetfu tetfu = new Tetfu(minoFactory, colorConverter);
    TetfuElement elementOnePage = parseBlockFieldToTetfuElement(initField, colorConverter, blockField, "");
    return "http://fumen.zui.jp/?v115@" + tetfu.encode(Collections.singletonList(elementOnePage));
}
Also used : Tetfu(common.tetfu.Tetfu) TetfuElement(common.tetfu.TetfuElement)

Example 12 with TetfuElement

use of common.tetfu.TetfuElement in project solution-finder by knewjade.

the class DevRandomEntryPoint method run.

@Override
public void run() throws FinderException {
    PatternGenerator generator = createBlockGenerator(pattern);
    List<Pieces> blocks = generator.blocksStream().collect(Collectors.toList());
    int index = new Random().nextInt(blocks.size());
    Pieces selected = blocks.get(index);
    String quiz = Tetfu.encodeForQuiz(selected.getPieces());
    MinoFactory minoFactory = new MinoFactory();
    ColorConverter converter = new ColorConverter();
    ColoredField coloredField = getTetfu(minoFactory, converter);
    Tetfu tetfu = new Tetfu(minoFactory, converter);
    TetfuElement element = new TetfuElement(coloredField, quiz);
    String encode = tetfu.encode(Collections.singletonList(element));
    System.out.println("v115@" + encode);
}
Also used : PatternGenerator(common.pattern.PatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) ArrayColoredField(common.tetfu.field.ArrayColoredField) ColoredField(common.tetfu.field.ColoredField) Random(java.util.Random) ColorConverter(common.tetfu.common.ColorConverter) MinoFactory(core.mino.MinoFactory) Tetfu(common.tetfu.Tetfu) EntryPoint(entry.EntryPoint) Pieces(common.datastore.blocks.Pieces) TetfuElement(common.tetfu.TetfuElement)

Aggregations

TetfuElement (common.tetfu.TetfuElement)12 Tetfu (common.tetfu.Tetfu)8 ColoredField (common.tetfu.field.ColoredField)7 ColorType (common.tetfu.common.ColorType)6 Field (core.field.Field)6 Piece (core.mino.Piece)6 BlockField (common.datastore.BlockField)5 ColorConverter (common.tetfu.common.ColorConverter)4 MinoFactory (core.mino.MinoFactory)4 MinoOperationWithKey (common.datastore.MinoOperationWithKey)2 ColoredFieldFactory (common.tetfu.field.ColoredFieldFactory)2 Collectors (java.util.stream.Collectors)2 ColumnParityLimitation (_implements.parity_based_pack.step1.ColumnParityLimitation)1 DeltaLimitedMino (_implements.parity_based_pack.step1.DeltaLimitedMino)1 EstimateBuilder (_implements.parity_based_pack.step1.EstimateBuilder)1 FullLimitedMino (_implements.parity_based_pack.step2.FullLimitedMino)1 PositionLimitParser (_implements.parity_based_pack.step2.PositionLimitParser)1 CrossBuilder (_implements.parity_based_pack.step3.CrossBuilder)1 BuildUp (common.buildup.BuildUp)1 OperationWithKeyComparator (common.comparator.OperationWithKeyComparator)1