Search in sources :

Example 6 with ListMaster

use of main.system.auxiliary.data.ListMaster in project Eidolons by IDemiurge.

the class DC_PagedLogPanel method getPageData.

@Override
protected List<List<String>> getPageData() {
    if (descriptionMode && game.getManager().getInfoObj() != null) {
        Obj entity = game.getManager().getInfoObj();
        String descr = entity.getDescription();
        String lore = entity.getProperty(G_PROPS.LORE);
        List<String> descrPages = TextWrapper.wrap(descr, descrWrapLength);
        List<String> lorePages = TextWrapper.wrap(lore, descrWrapLength);
        List<List<String>> list = new ArrayList<>();
        list.addAll(new ListMaster<String>().splitList(rowCount, descrPages));
        list.addAll(new ListMaster<String>().splitList(rowCount, lorePages));
        return list;
    }
    if (nodeViewMode) {
        List<String> lines = entryNode.getTextLines();
        return new ListMaster<String>().splitList(rowCount, lines);
    }
    ArrayList<String> lines = new ArrayList<>();
    List<String> entries = game.getLogManager().getTopDisplayedEntries();
    for (String entry : entries) {
        for (String subString : TextWrapper.wrapIntoArray(entry, EntryNodeMaster.getWrapLength(isTopPage()))) {
            lines.add(subString);
        }
    }
    // splitList(list)
    return new ListMaster<String>().splitList(getRowCount(), lines);
}
Also used : Obj(main.entity.obj.Obj) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) ListMaster(main.system.auxiliary.data.ListMaster)

Example 7 with ListMaster

use of main.system.auxiliary.data.ListMaster in project Eidolons by IDemiurge.

the class DC_RequirementsManager method getTotalCondition.

private Condition getTotalCondition(String valRef, String value) {
    List<PARAMETER> params;
    String str1 = "";
    if (valRef.contains(StringMaster.VAR_SEPARATOR)) {
        params = new ArrayList<>();
        for (String s : StringMaster.open(valRef, StringMaster.VAR_SEPARATOR)) {
            PARAMETER p = ContentManager.getPARAM(s);
            if (p == null) {
                p = ContentManager.getMastery(s);
            }
            if (p != null) {
                params.add(p);
            } else {
                VALUE_GROUP template = DC_ValueManager.getValueGroup(s);
                params.addAll(new ListMaster<PARAMETER>().getList(template.getParams()));
            }
        }
    } else {
        // TODO can we use VG_Condition here?
        VALUE_GROUP template = DC_ValueManager.getValueGroup(valRef);
        params = new ListMaster<PARAMETER>().getList(template.getParams());
    }
    for (PARAMETER p : params) {
        str1 += StringMaster.getValueRef(KEYS.SOURCE, p) + "+";
    }
    str1 = StringMaster.cropLast(str1, 1);
    return new NumericCondition(false, str1, value);
}
Also used : VALUE_GROUP(eidolons.content.DC_ValueManager.VALUE_GROUP) ListMaster(main.system.auxiliary.data.ListMaster) PARAMETER(main.content.values.parameters.PARAMETER)

Example 8 with ListMaster

use of main.system.auxiliary.data.ListMaster in project Eidolons by IDemiurge.

the class DC_MovementManager method buildPath.

public List<ActionPath> buildPath(Unit unit, Coordinates coordinates) {
    List<DC_ActiveObj> moves = getMoves(unit);
    PathBuilder builder = PathBuilder.getInstance().init(moves, new Action(unit.getAction("Move")));
    List<ActionPath> paths = builder.build(new ListMaster<Coordinates>().getList(coordinates));
    if (paths.isEmpty()) {
        return null;
    }
    return paths;
}
Also used : PathBuilder(eidolons.game.battlecraft.ai.tools.path.PathBuilder) Action(eidolons.game.battlecraft.ai.elements.actions.Action) DC_UnitAction(eidolons.entity.active.DC_UnitAction) ActionPath(eidolons.game.battlecraft.ai.tools.path.ActionPath) ListMaster(main.system.auxiliary.data.ListMaster) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj)

Example 9 with ListMaster

use of main.system.auxiliary.data.ListMaster in project Eidolons by IDemiurge.

the class EffectFinder method getBuffEffects.

public static List<Effect> getBuffEffects(Effect e, Class<?> CLASS) {
    List<Effect> list = new ArrayList<>();
    if (e instanceof AddBuffEffect) {
        AddBuffEffect addBuffEffect = (AddBuffEffect) e;
        Effect effect = addBuffEffect.getEffect();
        if (effect == null) {
            return list;
        }
        if (effect instanceof Effects) {
            Effects effects = (Effects) effect;
            for (Effect eff : effects) {
                if (ClassMaster.isInstanceOf(eff, CLASS)) {
                    list.add(eff);
                }
            }
        } else if (ClassMaster.isInstanceOf(effect, CLASS)) {
            return new ListMaster<Effect>().getList(effect);
        }
    }
    return list;
}
Also used : AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) ArrayList(java.util.ArrayList) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) ContainerEffect(main.ability.effects.ContainerEffect) AttackEffect(eidolons.ability.effects.oneshot.attack.AttackEffect) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) ModifyPropertyEffect(eidolons.ability.effects.common.ModifyPropertyEffect) RollEffect(eidolons.ability.effects.oneshot.mechanic.RollEffect) Effect(main.ability.effects.Effect) Effects(main.ability.effects.Effects) ListMaster(main.system.auxiliary.data.ListMaster)

Aggregations

ListMaster (main.system.auxiliary.data.ListMaster)9 Unit (eidolons.entity.obj.unit.Unit)3 ArrayList (java.util.ArrayList)3 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)2 Action (eidolons.game.battlecraft.ai.elements.actions.Action)2 ActionPath (eidolons.game.battlecraft.ai.tools.path.ActionPath)2 Coordinates (main.game.bf.Coordinates)2 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)1 ModifyPropertyEffect (eidolons.ability.effects.common.ModifyPropertyEffect)1 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)1 AttackEffect (eidolons.ability.effects.oneshot.attack.AttackEffect)1 RollEffect (eidolons.ability.effects.oneshot.mechanic.RollEffect)1 VALUE_GROUP (eidolons.content.DC_ValueManager.VALUE_GROUP)1 DC_UnitAction (eidolons.entity.active.DC_UnitAction)1 DC_Obj (eidolons.entity.obj.DC_Obj)1 GroupAI (eidolons.game.battlecraft.ai.GroupAI)1 PathBuilder (eidolons.game.battlecraft.ai.tools.path.PathBuilder)1 List (java.util.List)1 ContainerEffect (main.ability.effects.ContainerEffect)1 Effect (main.ability.effects.Effect)1