Search in sources :

Example 11 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class DataManager method getItemType.

private static ObjType getItemType(String typeName, OBJ_TYPE obj_type) {
    ObjType type = getBaseItemType(typeName, obj_type);
    if (type != null) {
        return type;
    }
    if (obj_type.equals(DC_TYPE.JEWELRY)) {
        // main.system.auxiliary.log.LogMaster.log(log,"NO JEWELRY!  "  );
        return null;
    }
    int i = 0;
    List<String> parts = StringMaster.openContainer(typeName, " ");
    String qualityName = parts.get(0);
    QUALITY_LEVEL q = new EnumMaster<QUALITY_LEVEL>().retrieveEnumConst(QUALITY_LEVEL.class, qualityName);
    if (q == null) {
        q = ItemEnums.QUALITY_LEVEL.NORMAL;
    } else {
        i++;
    }
    String materialName = parts.get(i);
    MATERIAL m = new EnumMaster<MATERIAL>().retrieveEnumConst(MATERIAL.class, materialName);
    while (m == null) {
        i++;
        if (i > parts.size() - 1) {
            return null;
        }
        materialName += " " + parts.get(i);
        m = new EnumMaster<MATERIAL>().retrieveEnumConst(MATERIAL.class, materialName);
    }
    String baseTypeName = "";
    for (int a = i; a <= parts.size() - 1; a++) {
        baseTypeName += parts.get(a) + " ";
    }
    ObjType baseType = getBaseItemType(baseTypeName, obj_type);
    // int j = 0;
    // if (baseType == null) {
    // baseType = getBaseItemType(parts.get(parts.size() - 2) + " "
    // + baseTypeName, obj_type);
    // j++;
    // }
    // typeName.replace(baseTypeName, "");
    // materialName = typeName.replace(qualityName, "");
    // while (parts.size() - i > j) {
    // materialName += parts.get(i) + " ";
    // i++;
    // }
    Map<MATERIAL, Map<ObjType, ObjType>> map = itemMaps.get(q);
    Map<ObjType, ObjType> map2 = map.get(m);
    return map2.get(baseType);
}
Also used : ObjType(main.entity.type.ObjType) EnumMaster(main.system.auxiliary.EnumMaster) QUALITY_LEVEL(main.content.enums.entity.ItemEnums.QUALITY_LEVEL) MATERIAL(main.content.enums.entity.ItemEnums.MATERIAL)

Example 12 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class DataManager method addType.

public static ObjType addType(String typeName, OBJ_TYPE TYPE) {
    ObjType objType = new ObjType(typeName, TYPE);
    addType(objType);
    return objType;
}
Also used : ObjType(main.entity.type.ObjType)

Example 13 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class DataManager method getFilteredTypes.

public static List<ObjType> getFilteredTypes(String filter, OBJ_TYPE OBJ_TYPE, VALUE filterValue) {
    Map<String, ObjType> map = XML_Reader.getTypeMaps().get(OBJ_TYPE.toString());
    List<ObjType> list = new ArrayList<>();
    boolean or = false;
    if (filter.contains(StringMaster.OR)) {
        or = true;
    }
    for (ObjType objName : map.values()) {
        if (or) {
            if (StringMaster.contains(filter, objName.getValue(filterValue))) {
                list.add(objName);
            }
        } else if (StringMaster.compare(objName.getValue(filterValue), filter, true)) {
            list.add(objName);
        }
    }
    if (list.isEmpty()) {
        for (ObjType objName : map.values()) {
            if (StringMaster.compare(objName.getValue(filterValue), filter, false)) {
                list.add(objName);
            }
        }
    }
    return list;
}
Also used : ObjType(main.entity.type.ObjType)

Example 14 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class DataManager method findTypes.

public static List<ObjType> findTypes(String typeName, boolean strict, OBJ_TYPE... TYPES) {
    List<ObjType> list = new ArrayList<>();
    for (OBJ_TYPE TYPE : TYPES) {
        if (TYPE instanceof C_OBJ_TYPE) {
            C_OBJ_TYPE C_TYPE = (C_OBJ_TYPE) TYPE;
            list.addAll(findTypes(typeName, strict, C_TYPE.getTypes()));
            continue;
        }
        // C_TYPES
        Map<String, ObjType> map = getTypeMap(TYPE);
        if (map != null) {
            for (String name : map.keySet()) {
                if (StringMaster.compareByChar(name, typeName, false)) {
                    list.add(map.get(name));
                    continue;
                }
                if (!strict) {
                    if (StringMaster.compare(name, typeName, false)) {
                        list.add(map.get(name));
                    }
                }
            }
        }
    }
    return list;
}
Also used : C_MACRO_OBJ_TYPE(main.content.enums.macro.C_MACRO_OBJ_TYPE) ObjType(main.entity.type.ObjType)

Example 15 with ObjType

use of main.entity.type.ObjType in project Eidolons by IDemiurge.

the class DataManager method overwriteType.

public static void overwriteType(ObjType type) {
    ObjType oldType = getType(type.getName(), type.getOBJ_TYPE_ENUM());
    if (oldType != null) {
        if (overwrittenTypes == null) {
            overwrittenTypes = new ArrayList<>();
        }
        overwrittenTypes.add(oldType);
    }
    addType(type);
}
Also used : ObjType(main.entity.type.ObjType)

Aggregations

ObjType (main.entity.type.ObjType)354 ArrayList (java.util.ArrayList)42 Coordinates (main.game.bf.Coordinates)30 Ref (main.entity.Ref)25 Unit (eidolons.entity.obj.unit.Unit)24 OBJ_TYPE (main.content.OBJ_TYPE)18 PROPERTY (main.content.values.properties.PROPERTY)18 DC_TYPE (main.content.DC_TYPE)16 PARAMETER (main.content.values.parameters.PARAMETER)16 File (java.io.File)15 Entity (main.entity.Entity)12 XLinkedMap (main.data.XLinkedMap)11 EnumMaster (main.system.auxiliary.EnumMaster)11 DC_SpellObj (eidolons.entity.active.DC_SpellObj)9 MATERIAL (main.content.enums.entity.ItemEnums.MATERIAL)9 Obj (main.entity.obj.Obj)9 QUALITY_LEVEL (main.content.enums.entity.ItemEnums.QUALITY_LEVEL)8 MusicList (main.music.entity.MusicList)8 Wave (eidolons.game.battlecraft.logic.battle.arena.Wave)6 C_OBJ_TYPE (main.content.C_OBJ_TYPE)6