Search in sources :

Example 36 with PROPERTY

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

the class AE_Manager method saveTreesIntoXML.

public static void saveTreesIntoXML() {
    OBJ_TYPE TYPE = C_OBJ_TYPE.XML_TYPES;
    PROPERTY XML_PROP = null;
    // }
    for (String typeName : cacheMap.keySet()) {
        ObjType type = DataManager.getType(typeName, TYPE);
        if (type == null) {
            continue;
        }
        if (type.getOBJ_TYPE_ENUM() == DC_TYPE.ABILS) {
            XML_PROP = G_PROPS.ABILITIES;
        } else {
            XML_PROP = PROPS.DIALOGUE_DATA;
        }
        saveTreeIntoXML(TYPE, XML_PROP, type);
    // dirty flag can help
    // XML_Writer.writeXML_ForType(type, TYPE);
    }
}
Also used : C_OBJ_TYPE(main.content.C_OBJ_TYPE) OBJ_TYPE(main.content.OBJ_TYPE) ObjType(main.entity.type.ObjType) PROPERTY(main.content.values.properties.PROPERTY)

Example 37 with PROPERTY

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

the class ReportView method init.

public void init() {
    PROPERTY prop = AT_PROPS.COMPLETED_TASKS;
    OBJ_TYPE TYPE = AT_OBJ_TYPE.TASK;
    List<ObjType> workedTasks = getTypeList(prop, TYPE);
    List<Task> completedTasks = new ArrayList<>();
    List<Task> failedTasks = new ArrayList<>();
// new ListMaster<>().toList(string)
// task comps? group by goals
// time spent,
// new G_ScrolledPanel<E>() {
// @Override
// protected G_Panel createComponent(E d) {
// // TODO Auto-generated method stub
// return null;
// }
// };
// state
// style
}
Also used : AT_OBJ_TYPE(main.logic.AT_OBJ_TYPE) OBJ_TYPE(main.content.OBJ_TYPE) Task(main.logic.Task) ObjType(main.entity.type.ObjType) PROPERTY(main.content.values.properties.PROPERTY) ArrayList(java.util.ArrayList)

Example 38 with PROPERTY

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

the class XML_Reader method constructTypeMap.

private static void constructTypeMap(Document doc, String key, Map<String, Set<String>> tabGroupMap, Map<String, Set<String>> treeSubGroupMap) {
    key = key.replace("_", " ").toLowerCase();
    LogMaster.log(LogMaster.DATA_DEBUG, "type map: " + key);
    Map<String, ObjType> typeMap = typeMaps.computeIfAbsent(key, k -> new XLinkedMap<>());
    NodeList nl = doc.getFirstChild().getChildNodes();
    Set<String> groupSet = new LinkedHashSet<>();
    for (int i = 0; i < nl.getLength(); i++) {
        Node node = nl.item(i);
        NodeList nl1 = node.getChildNodes();
        String aspect = node.getNodeName();
        PROPERTY groupingKey = DataManager.getGroupingKey(key);
        PROPERTY subGroupingKey = DataManager.getSubGroupingKey(key);
        for (int a = 0; a < nl1.getLength(); a++) {
            Node typeNode = nl1.item(a);
            String name = typeNode.getNodeName();
            if ("#text".equals(name)) {
                continue;
            }
            ObjType type = TypeBuilder.buildType(typeNode, key);
            if (type != null) {
                name = type.getName();
                // TAB GROUPS
                if (type.getProperty(groupingKey) == null) {
                    type.setProperty(G_PROPS.ASPECT, aspect);
                }
                groupSet.add(type.getProperty(groupingKey));
                aspect = type.getProperty(groupingKey);
                // TREE SUB GROUPS
                String subKey = type.getProperty(subGroupingKey);
                treeSubGroupMap.computeIfAbsent(aspect, k -> new HashSet<>()).add(subKey);
                typeMap.put(name, type);
                LogMaster.log(LogMaster.DATA_DEBUG, typeNode.getNodeName() + " has been put into map as " + type);
            }
        }
    }
    if (tabGroupMap.get(key) == null) {
        tabGroupMap.put(key, groupSet);
    } else {
        tabGroupMap.get(key).addAll(groupSet);
    }
// if (key.equals(StringS.ABILS.getName())) {
// Err.info(set + "");
// }
}
Also used : DC_TYPE(main.content.DC_TYPE) LogMaster(main.system.auxiliary.log.LogMaster) java.util(java.util) ObjType(main.entity.type.ObjType) NodeList(org.w3c.dom.NodeList) PROPERTY(main.content.values.properties.PROPERTY) DequeImpl(main.system.datatypes.DequeImpl) Game(main.game.core.game.Game) XLinkedMap(main.data.XLinkedMap) CoreEngine(main.system.launch.CoreEngine) File(java.io.File) PARAMETER(main.content.values.parameters.PARAMETER) MapMaster(main.system.auxiliary.data.MapMaster) TypeBuilder(main.system.launch.TypeBuilder) DataManager(main.data.DataManager) Document(org.w3c.dom.Document) Node(org.w3c.dom.Node) Chronos(main.system.auxiliary.log.Chronos) FileManager(main.system.auxiliary.data.FileManager) OBJ_TYPE(main.content.OBJ_TYPE) G_PROPS(main.content.values.properties.G_PROPS) PathFinder(main.data.filesys.PathFinder) ObjType(main.entity.type.ObjType) PROPERTY(main.content.values.properties.PROPERTY) NodeList(org.w3c.dom.NodeList) Node(org.w3c.dom.Node)

Example 39 with PROPERTY

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

the class DataModel method cloneMapsWithExceptions.

public void cloneMapsWithExceptions(DataModel type, VALUE... exceptions) {
    Map<VALUE, String> map = new HashMap<>();
    for (VALUE exception : exceptions) {
        map.put(exception, getValue(exception));
    }
    this.propMap = clonePropMap(type.getPropMap().getMap());
    this.paramMap = cloneParamMap(type.getParamMap().getMap());
    for (VALUE exception : exceptions) {
        String value = map.get(exception);
        if (exception instanceof PARAMETER) {
            paramMap.put(exception.getName(), value);
        } else if (exception instanceof PROPERTY) {
            propMap.put(exception.getName(), value);
        }
    }
    setDirty(true);
}
Also used : HashMap(java.util.HashMap) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) PROPERTY(main.content.values.properties.PROPERTY) VALUE(main.content.VALUE) PARAMETER(main.content.values.parameters.PARAMETER)

Example 40 with PROPERTY

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

the class DataModel method mergeValues.

public void mergeValues(Entity type, VALUE... vals) {
    for (VALUE val : vals) {
        if (val instanceof PROPERTY) {
            PROPERTY property = (PROPERTY) val;
            addProperty(property, type.getProperty(property), true);
        } else {
            if (val instanceof PARAMETER) {
                PARAMETER parameter = (PARAMETER) val;
                addParam(parameter, type.getParam(parameter), false);
            }
        }
    }
}
Also used : PROPERTY(main.content.values.properties.PROPERTY) VALUE(main.content.VALUE) PARAMETER(main.content.values.parameters.PARAMETER)

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