Search in sources :

Example 1 with BuildParameters

use of eidolons.game.battlecraft.logic.dungeon.location.building.BuildHelper.BuildParameters in project Eidolons by IDemiurge.

the class LE_MapMaster method initBuildParams.

public static BuildParameters initBuildParams(boolean empty, Location location) {
    BuildParameters params = new BuildHelper(location).new BuildParameters(empty);
    params.setValue(BUILD_PARAMS.WIDTH, "" + location.getCellsX());
    params.setValue(BUILD_PARAMS.HEIGHT, "" + location.getCellsY());
    if (location.getPlan() != null) {
        params.setValue(BUILD_PARAMS.WIDTH_MOD, "" + location.getPlan().getWidthMod());
        params.setValue(BUILD_PARAMS.HEIGHT_MOD, "" + location.getPlan().getHeightMod());
        params.setValue(BUILD_PARAMS.SIZE_MOD, "" + location.getPlan().getSizeMod());
    }
    String data = params.getDataMapFormat();
    data = TextEditor.inputTextLargeField("Alter build parameters...", data);
    if (data != null) {
        params = new BuildHelper(location).new BuildParameters(data);
        location.setParam(PARAMS.BF_WIDTH, params.getIntValue(BUILD_PARAMS.WIDTH));
        location.setParam(PARAMS.BF_HEIGHT, params.getIntValue(BUILD_PARAMS.HEIGHT));
        location.setProperty(PROPS.FILLER_TYPE, params.getValue(BUILD_PARAMS.FILLER_TYPE));
        location.getType().setParam(PARAMS.BF_WIDTH, params.getIntValue(BUILD_PARAMS.WIDTH));
        location.getType().setParam(PARAMS.BF_HEIGHT, params.getIntValue(BUILD_PARAMS.HEIGHT));
        location.getType().setProperty(PROPS.FILLER_TYPE, params.getValue(BUILD_PARAMS.FILLER_TYPE));
        location.setBuildParams(params);
    }
    GuiManager.setCurrentLevelCellsX(location.getCellsX());
    GuiManager.setCurrentLevelCellsY(location.getCellsY());
    return params;
}
Also used : BuildParameters(eidolons.game.battlecraft.logic.dungeon.location.building.BuildHelper.BuildParameters) BuildHelper(eidolons.game.battlecraft.logic.dungeon.location.building.BuildHelper)

Aggregations

BuildHelper (eidolons.game.battlecraft.logic.dungeon.location.building.BuildHelper)1 BuildParameters (eidolons.game.battlecraft.logic.dungeon.location.building.BuildHelper.BuildParameters)1