use of util.fig.generator.AllFigGenerator 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");
}
Aggregations