Search in sources :

Example 1 with FigSetting

use of util.fig.FigSetting in project solution-finder by knewjade.

the class FigUtilEntryPoint method createFigGenerator.

private FigGenerator createFigGenerator(FrameType frameType, boolean isUsingHold, MinoFactory minoFactory, ColorConverter colorConverter) {
    int height = settings.getHeight();
    int nextBoxCount = settings.getNextBoxCount();
    assert 0 <= nextBoxCount;
    FigSetting figSetting = new FigSetting(frameType, height, nextBoxCount);
    switch(frameType) {
        case NoFrame:
            return new FieldOnlyFigGenerator(figSetting, minoFactory, colorConverter);
        case Basic:
            if (!isUsingHold)
                return new NoHoldFigGenerator(figSetting, minoFactory, colorConverter);
            BasicPositionDecider basicPositionDecider = new BasicPositionDecider(figSetting);
            return new AllFigGenerator(figSetting, basicPositionDecider, minoFactory, colorConverter);
        case Right:
            if (!isUsingHold)
                return new NoHoldFigGenerator(figSetting, minoFactory, colorConverter);
            RightPositionDecider rightPositionDecider = new RightPositionDecider(figSetting);
            return new AllFigGenerator(figSetting, rightPositionDecider, minoFactory, colorConverter);
    }
    throw new IllegalStateException("No reachable");
}
Also used : NoHoldFigGenerator(util.fig.generator.NoHoldFigGenerator) FieldOnlyFigGenerator(util.fig.generator.FieldOnlyFigGenerator) AllFigGenerator(util.fig.generator.AllFigGenerator) RightPositionDecider(util.fig.position.RightPositionDecider) FigSetting(util.fig.FigSetting) EntryPoint(entry.EntryPoint) BasicPositionDecider(util.fig.position.BasicPositionDecider)

Aggregations

EntryPoint (entry.EntryPoint)1 FigSetting (util.fig.FigSetting)1 AllFigGenerator (util.fig.generator.AllFigGenerator)1 FieldOnlyFigGenerator (util.fig.generator.FieldOnlyFigGenerator)1 NoHoldFigGenerator (util.fig.generator.NoHoldFigGenerator)1 BasicPositionDecider (util.fig.position.BasicPositionDecider)1 RightPositionDecider (util.fig.position.RightPositionDecider)1