Search in sources :

Example 1 with VALUE

use of main.content.VALUE in project Eidolons by IDemiurge.

the class PropertyPage method init.

@Override
protected void init() {
    X = super.getDefaultX();
    Y = getDefaultY();
    i = 0;
    Z = getDefaultZ();
    if (isAddHeader()) {
        addHeader();
    }
    resetDisplayedValues();
    for (VALUE p : displayedValues) {
        EntityValueComponent comp = getComponent(p);
        super.addComponent(comp, p);
    }
}
Also used : VALUE(main.content.VALUE)

Example 2 with VALUE

use of main.content.VALUE in project Eidolons by IDemiurge.

the class ValueIconPanel method createBoxes.

protected void createBoxes() {
    removeAll();
    boxes = new XLinkedMap<>();
    int x = 0;
    int y;
    for (VALUE[] values : getValueColumns()) {
        y = 0;
        for (VALUE value : values) {
            ValueBox box = getValueBox(value);
            boxes.put(value, box);
            String pos = "pos " + x + " " + y;
            add(box, pos);
            y += ROW_HEIGHT;
            box.addMouseListener(ToolTipMaster.getValueMouseListener(value));
        }
        x += COLUMN_WIDTH;
    }
    revalidate();
}
Also used : VALUE(main.content.VALUE)

Example 3 with VALUE

use of main.content.VALUE in project Eidolons by IDemiurge.

the class ReportGenerator method getSessionReport.

private static String getSessionReport(Session session) {
    // Session previousVersion
    Map<VALUE, String> map = VersionMaster.getVersionDifferenceMap(VERSION_PERIOD.SESSION, 1, session);
    String report = getReportName(session);
    for (VALUE v : map.keySet()) {
        report += v + ": " + map.get(v) + ";" + StringMaster.NEW_LINE;
    }
    // String notes;
    return report;
}
Also used : VALUE(main.content.VALUE)

Example 4 with VALUE

use of main.content.VALUE in project Eidolons by IDemiurge.

the class InfoTable method initComponents.

protected void initComponents() {
    for (int y = 0; y < rows; y++) {
        int x = 0;
        for (VALUE value : valueTable[y]) {
            boolean special = false;
            PropertyComponent comp = new PropertyComponent(value, obj, special);
            components.add(comp);
            String pos = "sg comps, wrap, " + "pos 0 " + y * comp.getPanelSize().getHeight() * y;
            add(comp, pos);
        }
        x++;
    }
}
Also used : VALUE(main.content.VALUE)

Example 5 with VALUE

use of main.content.VALUE in project Eidolons by IDemiurge.

the class TextParser method parseRef.

// perhaps I should refactor into method per parse_type!
private static String parseRef(String ref_substring, Ref ref) {
    if (ref == null) {
        return parseVarRef(ref_substring);
    }
    String value = StringMaster.cropRef(ref_substring);
    if (!StringMaster.isInteger(value)) {
        if (isAbilityParsing()) {
            return ref_substring;
        }
    }
    int id = 0;
    if (isActiveParsing()) {
        id = ref.getId(KEYS.ACTIVE);
    } else {
        try {
            id = ref.getId(KEYS.INFO);
        } catch (Exception e) {
        }
    }
    Game game = ref.getGame();
    // if (id == 0) {
    // if (game.isRunning()) {
    // id = game.getManager().getInfoObj().getId();
    // }
    // }
    // else if (CharacterCreator.isRunning())
    String replacement = ref_substring;
    Entity entity = ref.getInfoEntity();
    if (entity == null) {
        if (game.isSimulation() && !isBuffParsing() && !isAbilityParsing()) {
            entity = game.getTypeById(id);
        } else {
            entity = game.getObjectById(id);
        }
    }
    if (entity == null) {
        return ref_substring;
    }
    if (entity instanceof AbilityObj) {
        entity = entity.getType();
    }
    if (StringMaster.isInteger(value)) {
        int index = StringMaster.getInteger(value) - 1;
        String varProp = entity.getProperty(G_PROPS.VARIABLES);
        if (StringMaster.isEmpty(varProp)) {
            varProp = DEFAULT_VARS;
        }
        boolean containerFormula = false;
        if (!entity.getParam("FORMULA").isEmpty()) {
            // StringMaster.compare(varProp.replace(";", ""), "FORMULA",
            // true)) {
            varProp = entity.getParam("FORMULA");
            containerFormula = true;
        }
        List<String> openContainer = StringMaster.openContainer(varProp);
        if (openContainer.size() > index) {
            VALUE val = null;
            if (!containerFormula && !isBuffParsing()) {
                val = ContentManager.getValue(openContainer.get(index));
                replacement = entity.getValue(val);
            } else {
                replacement = openContainer.get(index);
            }
            if (containerFormula || val instanceof PARAMETER) {
                if (StringMaster.isInteger(replacement)) {
                    return replacement;
                }
                try {
                    if (isAbilityParsing()) // if (replacement.contains(",")) {
                    // // TODO all function names!
                    // if (replacement.toLowerCase().contains("min")
                    // || replacement.toLowerCase().contains(
                    // "max")) {
                    // // get the insides of the formula?
                    // // parts = replacement.split(regex);
                    // // parts[1] = parts[1].
                    // //
                    // // replacement = parts[0] + parts[1];
                    // return replacement.replace(",",
                    // StringMaster.COMMA_CODE);
                    // }
                    // } else
                    {
                        return replacement.replace(",", StringMaster.COMMA_CODE);
                    }
                    if (game.isSimulation()) {
                        replacement = new Formula(replacement).getInt(ref) + " (" + formatFormula(replacement) + ")";
                    } else {
                        replacement = new Formula(replacement).getInt(ref) + "";
                    }
                } catch (Exception e) {
                    main.system.ExceptionMaster.printStackTrace(e);
                }
            } else {
                String result = new Property(true, replacement).getStr(ref);
                if (StringMaster.isEmpty(result)) {
                    replacement = new Parameter(replacement).getInt(ref) + "";
                } else {
                    replacement = result;
                }
            }
        }
    } else {
        if (!isAbilityParsing()) {
            if (StringMaster.isInteger(replacement)) {
                return replacement;
            }
            if (game.isSimulation() && !tooltipParsing) {
                Integer VAL = new Formula(replacement).getInt(ref);
                replacement = VAL + " (" + replacement + ")";
            } else {
                // TODO
                replacement = new Formula(replacement).getInt(ref) + "";
            }
        // props!
        }
    }
    return replacement;
}
Also used : Entity(main.entity.Entity) VALUE(main.content.VALUE) AbilityObj(main.ability.AbilityObj) Formula(main.system.math.Formula) Game(main.game.core.game.Game) Parameter(main.system.math.Parameter) Property(main.system.math.Property) PARAMETER(main.content.values.parameters.PARAMETER)

Aggregations

VALUE (main.content.VALUE)33 ObjType (main.entity.type.ObjType)8 PARAMETER (main.content.values.parameters.PARAMETER)7 ArrayList (java.util.ArrayList)5 PROPERTY (main.content.values.properties.PROPERTY)5 PARAMS (eidolons.content.PARAMS)3 UNIT_INFO_PARAMS (eidolons.content.UNIT_INFO_PARAMS)2 MultiValueContainer (eidolons.libgdx.gui.panels.dc.unitinfo.MultiValueContainer)2 List (java.util.List)2 OBJ_TYPE (main.content.OBJ_TYPE)2 G_PROPS (main.content.values.properties.G_PROPS)2 Obj (main.entity.obj.Obj)2 Formula (main.system.math.Formula)2 ChoiceSequence (eidolons.client.cc.gui.neo.choice.ChoiceSequence)1 EntityChoiceView (eidolons.client.cc.gui.neo.choice.EntityChoiceView)1 SequenceManager (eidolons.client.dc.SequenceManager)1 DC_UnitAction (eidolons.entity.active.DC_UnitAction)1 DC_Obj (eidolons.entity.obj.DC_Obj)1 Unit (eidolons.entity.obj.unit.Unit)1 FutureBuilder (eidolons.game.battlecraft.ai.tools.future.FutureBuilder)1