Search in sources :

Example 11 with PROPERTY

use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.

the class InventoryTransactionManager method updateType.

public static void updateType(Unit hero) {
    hero.setType(new ObjType(hero.getType()));
    ObjType type = hero.getType();
    // TODO init type?
    hero.getGame().initType(type);
    for (PROPERTY prop : INV_PROPS) {
        type.copyValue(prop, hero);
    // String property = hero.getProperty(prop);for (String item :
    // StringMaster.openContainer(property)) {
    // if (hero.getGame().getObjectById(StringMaster.getInteger(item))
    // != null) {
    // String string = hero.getGame()
    // .getObjectById(StringMaster.getInteger(item))
    // .getId().toString();
    // // .getName();
    // if (prop.isContainer())
    // type.addProperty(prop, string);
    // else
    // type.setProperty(prop, string);
    // }
    // }
    // type.setProperty(prop, property);
    }
}
Also used : ObjType(main.entity.type.ObjType) PROPERTY(main.content.values.properties.PROPERTY)

Example 12 with PROPERTY

use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.

the class Level method getXml.

public String getXml() {
    String xml = XML_Converter.openXmlFormatted("Level");
    xml += XML_Converter.openXmlFormatted("Custom Props");
    for (PROPERTY prop : location.getPropMap().keySet()) {
        String value = location.getProperty(prop);
        if (prop == G_PROPS.WORKSPACE_GROUP || prop == PROPS.ENEMY_SPAWN_COORDINATES || prop == PROPS.PARTY_SPAWN_COORDINATES || !value.equals(location.getType().getType().getProperty(prop))) // dungeon.getType().getType() - original type
        {
            xml += XML_Converter.wrapLeaf(prop.getName(), value);
        }
    }
    xml += XML_Converter.closeXmlFormatted("Custom Props");
    xml += XML_Converter.openXmlFormatted("Custom Params");
    for (PARAMETER param : location.getParamMap().keySet()) {
        String value = location.getParam(param);
        if (!value.equals(location.getType().getType().getParam(param))) {
            xml += XML_Converter.wrapLeaf(param.getName(), value);
        }
    }
    xml += XML_Converter.closeXmlFormatted("Custom Params");
    String wallObjData = getWallObjData();
    xml += XML_Converter.wrapLeaf(DungeonBuilder.WALL_OBJ_DATA_NODE, wallObjData);
    String facingMapData = getFacingMapData();
    if (!facingMapData.isEmpty()) {
        xml += XML_Converter.wrapLeaf(DungeonBuilder.DIRECTION_MAP_NODE, facingMapData);
    }
    String aiGroupData = getAiGroupData();
    if (!aiGroupData.isEmpty()) {
        xml += XML_Converter.wrapLeaf(LocationBuilder.AI_GROUPS_NODE, aiGroupData);
    }
    xml += location.getPlan().getXml();
    xml += XML_Converter.closeXmlFormatted("Level");
    return xml;
}
Also used : PROPERTY(main.content.values.properties.PROPERTY) PARAMETER(main.content.values.parameters.PARAMETER)

Example 13 with PROPERTY

use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.

the class Mission method getData.

public String getData() {
    String data = "";
    // obj.setProperty(MACRO_PROPS.DUNGEON_LEVELS,
    // StringMaster.constructContainer(ListMaster
    // .toStringList(levels.toArray())));
    data += XML_Converter.openXmlFormatted("Custom Props");
    for (PROPERTY p : obj.getPropMap().keySet()) {
        String value = obj.getProperty(p);
        if (!StringMaster.compareByChar(value, obj.getType().getProperty(p))) {
            // data += portrait.getName() + "=" + value + ",";
            data += XML_Converter.wrapLeaf(p.getName(), value);
        }
    }
    data += XML_Converter.closeXmlFormatted("Custom Props");
    data += XML_Converter.openXmlFormatted("Custom Params");
    for (PARAMETER p : obj.getParamMap().keySet()) {
        String value = obj.getParam(p);
        if (!StringMaster.compareByChar(value, obj.getType().getParam(p))) {
            // data += portrait.getName() + "=" + value + ";";
            data += XML_Converter.wrapLeaf(p.getName(), value);
        }
    }
    data += XML_Converter.closeXmlFormatted("Custom Params");
    // }
    return data;
}
Also used : PROPERTY(main.content.values.properties.PROPERTY) PARAMETER(main.content.values.parameters.PARAMETER)

Example 14 with PROPERTY

use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.

the class XML_Transformer method renameType.

public static void renameType(ObjType type, String newName, PROPERTY... props) {
    // backUp();
    // after files are read
    boolean dynamic = false;
    if (props == null) {
        dynamic = true;
    }
    // props = getValuesForType(obj_type);
    for (PROPERTY prop : props) {
        if (dynamic) {
        }
        for (OBJ_TYPE key : ContentManager.getOBJ_TYPEsForValue(prop)) {
            for (ObjType objType : DataManager.getTypes(key)) {
                String value = objType.getProperty(prop);
                value = value.replaceAll(type.getName(), newName);
                objType.setProperty(prop, value);
            }
            XML_Writer.writeXML_ForTypeGroup(key);
        }
    }
    type.setName(newName);
    XML_Writer.writeXML_ForType(type, type.getOBJ_TYPE_ENUM());
// XML_File file = getFile(type.getOBJ_TYPE_ENUM());
// String newContents = file
// .getContents()
// .replaceAll(XML_Converter.openXML(type.getName()), XML_Converter
// .openXML(newName));
// newContents =
// file.getContents().replaceAll(XML_Converter.closeXML(type
// .getName()), XML_Converter.closeXML(newName));
// String nameOpen = XML_Converter.openXML(type.getName());
// String nameClose = XML_Converter.closeXML(type.getName());
// newContents = file.getContents().replaceFirst(nameOpen +
// type.getName()
// + nameClose, nameOpen + newName + nameClose);
// file.setContents(newContents);
// XML_Writer.write(file);
}
Also used : ObjType(main.entity.type.ObjType) PROPERTY(main.content.values.properties.PROPERTY)

Example 15 with PROPERTY

use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.

the class MC_ControlPanel method massEdit.

public static void massEdit(boolean emptyOnly) {
    List<ObjType> types = DataManager.getTypes(AT_OBJ_TYPE.MUSIC_LIST);
    VALUE prop = getMassFilterValue();
    if (prop != null) {
        String filterValue = inputMassValue(prop);
        for (ObjType sub : new ArrayList<>(types)) // if (emptyOnly) {
        {
            if (!sub.checkContainerProp((PROPERTY) prop, filterValue, true)) {
                types.remove(sub);
            }
        }
    // } else if (!generic.checkValue(prop, filterValue))
    // types.remove(generic);
    }
    prop = getMassEditValue();
    if (prop == null) {
        return;
    }
    if (emptyOnly) {
        for (ObjType sub : new ArrayList<>(types)) {
            if (sub.checkValue(prop)) {
                types.remove(sub);
            }
        }
    }
    massEdit(types, prop);
}
Also used : ObjType(main.entity.type.ObjType) PROPERTY(main.content.values.properties.PROPERTY) VALUE(main.content.VALUE)

Aggregations

PROPERTY (main.content.values.properties.PROPERTY)57 PARAMETER (main.content.values.parameters.PARAMETER)23 ObjType (main.entity.type.ObjType)17 OBJ_TYPE (main.content.OBJ_TYPE)6 ArrayList (java.util.ArrayList)5 VALUE (main.content.VALUE)5 Ref (main.entity.Ref)5 DC_TYPE (main.content.DC_TYPE)4 Node (org.w3c.dom.Node)4 DC_SpellObj (eidolons.entity.active.DC_SpellObj)3 Unit (eidolons.entity.obj.unit.Unit)3 XLinkedMap (main.data.XLinkedMap)3 Obj (main.entity.obj.Obj)3 EnumMaster (main.system.auxiliary.EnumMaster)3 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)2 ModifyPropertyEffect (eidolons.ability.effects.common.ModifyPropertyEffect)2 File (java.io.File)2 List (java.util.List)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 MOD_PROP_TYPE (main.ability.effects.Effect.MOD_PROP_TYPE)2