Search in sources :

Example 1 with MASTERY

use of main.content.enums.entity.SkillEnums.MASTERY in project Eidolons by IDemiurge.

the class UnitLevelManager method getRandomParameter.

private PARAMETER getRandomParameter(boolean attrs, Entity newType) {
    PARAMETER param;
    if (attrs) {
        ATTRIBUTE a = new RandomWizard<ATTRIBUTE>().getObjectByWeight(newType.getProperty(PROPS.ATTRIBUTE_PROGRESSION), ATTRIBUTE.class);
        param = ContentManager.getBaseAttribute(ContentManager.getPARAM(a.toString()));
    } else {
        MASTERY mstr = new RandomWizard<MASTERY>().getObjectByWeight(newType.getProperty(PROPS.MASTERY_PROGRESSION), MASTERY.class);
        if (mstr == null) {
            return null;
        }
        // TODO complete the ENUM!!!
        param = ContentManager.getPARAM(mstr.toString());
        if (param == null) {
            param = ContentManager.findPARAM(mstr.toString());
        }
    }
    return param;
}
Also used : ATTRIBUTE(eidolons.content.DC_ContentManager.ATTRIBUTE) MASTERY(main.content.enums.entity.SkillEnums.MASTERY) PARAMETER(main.content.values.parameters.PARAMETER)

Example 2 with MASTERY

use of main.content.enums.entity.SkillEnums.MASTERY in project Eidolons by IDemiurge.

the class TreeControlPanel method handleControl.

public void handleControl(TREE_CONTROLS c, boolean alt) {
    ObjType selectedType = view.getTree().getSelectedType();
    switch(c) {
        case TEST:
            AutoTestMaster.testType(selectedType);
            break;
        case WS_CYCLE:
            workspaceCycle(alt);
            break;
        case WS_TOGGLE:
            if (alt) {
                if (view instanceof SkillTreeView) {
                    SkillTreeView skillTreeView = (SkillTreeView) view;
                    String enums = new ListChooser(SELECTION_MODE.MULTIPLE, MASTERY.class).choose();
                    if (StringMaster.isEmpty(enums)) {
                        return;
                    }
                    List<MASTERY> list = new EnumMaster<MASTERY>().getEnumList(MASTERY.class, enums);
                    skillTreeView.setWorkspace(list.toArray(new MASTERY[list.size()]));
                    view.setWorkspaceMode(true);
                    view.refresh();
                    return;
                }
            }
            view.setWorkspaceMode(!view.isWorkspaceMode());
            view.refresh();
            break;
        case LINK:
            view.adjustLink(null, HC_Master.getSelectedTreeNode());
            break;
        // break;
        case OFFSET_X:
            view.adjustOffset(alt, true, HC_Master.getSelectedTreeNode());
            break;
        case OFFSET_Y:
            view.adjustOffset(alt, false, HC_Master.getSelectedTreeNode());
            break;
        case REBUILD:
            view.rebuildAndSetTree();
            break;
        case ALT_BASE:
            if (alt) {
                view.editAltBaseLink(selectedType);
                break;
            }
            view.addAltBase(selectedType);
            break;
        case SET:
            setProp(alt, selectedType);
            view.rebuildAndSetTree();
            break;
        default:
            break;
    }
}
Also used : MASTERY(main.content.enums.entity.SkillEnums.MASTERY) ObjType(main.entity.type.ObjType) ListChooser(main.swing.generic.components.editors.lists.ListChooser)

Aggregations

MASTERY (main.content.enums.entity.SkillEnums.MASTERY)2 ATTRIBUTE (eidolons.content.DC_ContentManager.ATTRIBUTE)1 PARAMETER (main.content.values.parameters.PARAMETER)1 ObjType (main.entity.type.ObjType)1 ListChooser (main.swing.generic.components.editors.lists.ListChooser)1