Search in sources :

Example 1 with OBJ_TYPE

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

the class XML_Writer method saveAll.

public static void saveAll() {
    for (String typeName : XML_Reader.getTypeMaps().keySet()) {
        OBJ_TYPE type = ContentManager.getOBJ_TYPE(typeName);
        if (isWritingBlocked(type)) {
            continue;
        }
        writeXML_ForTypeGroup(type);
    }
}
Also used : OBJ_TYPE(main.content.OBJ_TYPE)

Example 2 with OBJ_TYPE

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

the class ListSizeCondition method check.

@Override
public boolean check(Ref ref) {
    OBJ_TYPE TYPE = C_OBJ_TYPE.BF;
    if (bfObj) {
        TYPE = C_OBJ_TYPE.BF_OBJ;
    }
    if (filter == null) {
        filter = new Filter<>(ref, c, TYPE);
    } else {
        filter.setRef(ref);
    }
    int size = new Formula(sizeFormula).getInt(ref);
    return filter.getObjects().size() >= size;
}
Also used : Formula(main.system.math.Formula) C_OBJ_TYPE(main.content.C_OBJ_TYPE) OBJ_TYPE(main.content.OBJ_TYPE)

Example 3 with OBJ_TYPE

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

the class DC_RequirementsManager method getRequirements.

@Override
public Requirements getRequirements(Entity type, int mode) {
    Map<Entity, Requirements> map = getReqMap(mode);
    if (map != null) {
        if (// TODO
        map.get(type) != null) {
            return map.get(type);
        }
    }
    Requirements req = null;
    OBJ_TYPE TYPE = type.getOBJ_TYPE_ENUM();
    if (TYPE instanceof DC_TYPE) {
        switch((DC_TYPE) TYPE) {
            case ARMOR:
                req = generateItemRequirements(type, mode);
                break;
            case ITEMS:
                req = generateItemRequirements(type, mode);
                break;
            case CLASSES:
                req = generateClassRequirements(type, mode);
                break;
            case SKILLS:
                req = generateSkillRequirements(type, mode);
                break;
            case SPELLS:
                req = generateSpellRequirements(type, mode);
                break;
            case WEAPONS:
                req = generateItemRequirements(type, mode);
                break;
            case UNITS:
                break;
            case ACTIONS:
                break;
            default:
                break;
        }
    }
    if (req == null) {
        return null;
    }
    String additionalRequirements = type.getProperty(PROPS.REQUIREMENTS);
    if (!StringMaster.isEmpty(additionalRequirements)) {
        try {
            req.addAll(toRequirements(additionalRequirements));
        } catch (Exception e) {
            LogMaster.log(1, type + "'s req failed! - " + additionalRequirements);
        // main.system.ExceptionMaster.printStackTrace(e);
        }
    }
    if (type.isUpgrade() && TYPE != null) {
        Requirement baseTypeRequirement = getBaseTypeRequirement(type, TYPE);
        if (baseTypeRequirement != null) {
            req.add(baseTypeRequirement);
        }
    }
    if (map != null) {
        map.put(type, req);
    }
    return req;
}
Also used : Entity(main.entity.Entity) OBJ_TYPE(main.content.OBJ_TYPE) DC_TYPE(main.content.DC_TYPE)

Example 4 with OBJ_TYPE

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

the class StateManager method addObject.

public void addObject(Obj obj) {
    state.objMap.put(obj.getId(), obj);
    OBJ_TYPE TYPE = obj.getOBJ_TYPE_ENUM();
    if (TYPE == null) {
        LogMaster.log(1, obj.toString() + " has no TYPE!");
        return;
    }
    Map<Integer, Obj> map = state.getObjMaps().get(TYPE);
    if (map == null) {
        return;
    }
    // if (!map.containsValue(obj))
    map.put(obj.getId(), obj);
}
Also used : OBJ_TYPE(main.content.OBJ_TYPE) Obj(main.entity.obj.Obj)

Example 5 with OBJ_TYPE

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

the class LE_Palette method newPalette.

public void newPalette() {
    int optionChoice = DialogMaster.optionChoice("Choose object TYPE...", default_palette);
    OBJ_TYPE TYPE;
    List<ObjType> typeList;
    if (optionChoice == -1) {
        if (DialogMaster.confirm("Multi-type Palette?")) {
            optionChoice = DialogMaster.optionChoice("Choose object multi TYPE...", multi_types);
            if (optionChoice == -1) {
                return;
            }
            TYPE = multi_types[optionChoice];
            typeList = DataManager.getTypes(TYPE);
        } else {
            return;
        }
    } else {
        TYPE = default_palette[optionChoice];
        typeList = DataManager.getTypes(TYPE);
    }
    // int index = DialogMaster.optionChoice("Choose object TYPE...",
    // palettes.toArray());
    // PaletteWorkspace ws = palettes.getOrCreate(index);
    List<String> listData = DataManager.toStringList(typeList);
    List<String> secondListData = (TYPE instanceof C_OBJ_TYPE) ? new ArrayList<>() : DataManager.toStringList(typeList);
    // if (ws != null) {
    // secondListData = DataManager.convertToStringList(ws.getTypeList());
    // }
    String data = new ListChooser(listData, secondListData, false, TYPE).choose();
    if (data == null) {
        return;
    }
    List<ObjType> list = DataManager.toTypeList(data, TYPE);
    String name = DialogMaster.inputText();
    imagePath = new ImageChooser().launch(imagePath, "");
    PaletteWorkspace ws = new PaletteWorkspace(name, list, imagePath);
    addWorkspaceTab(ws);
    saveWorkspace(ws);
}
Also used : C_OBJ_TYPE(main.content.C_OBJ_TYPE) C_OBJ_TYPE(main.content.C_OBJ_TYPE) OBJ_TYPE(main.content.OBJ_TYPE) ObjType(main.entity.type.ObjType) ImageChooser(main.swing.generic.components.editors.ImageChooser) ListChooser(main.swing.generic.components.editors.lists.ListChooser)

Aggregations

OBJ_TYPE (main.content.OBJ_TYPE)31 ObjType (main.entity.type.ObjType)16 C_OBJ_TYPE (main.content.C_OBJ_TYPE)7 ArrayList (java.util.ArrayList)5 PROPERTY (main.content.values.properties.PROPERTY)5 Obj (main.entity.obj.Obj)5 Entity (main.entity.Entity)3 DC_SpellObj (eidolons.entity.active.DC_SpellObj)2 Unit (eidolons.entity.obj.unit.Unit)2 File (java.io.File)2 VALUE (main.content.VALUE)2 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 Actor (com.badlogic.gdx.scenes.scene2d.Actor)1 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)1 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)1 NinePatchDrawable (com.badlogic.gdx.scenes.scene2d.utils.NinePatchDrawable)1 ChoiceSequence (eidolons.client.cc.gui.neo.choice.ChoiceSequence)1 EntityChoiceView (eidolons.client.cc.gui.neo.choice.EntityChoiceView)1 HC_PagedListPanel (eidolons.client.cc.gui.pages.HC_PagedListPanel)1 SequenceManager (eidolons.client.dc.SequenceManager)1