Search in sources :

Example 16 with XLinkedMap

use of main.data.XLinkedMap in project Eidolons by IDemiurge.

the class CounterMasterAdvanced method createCounterMap.

private static Map<COUNTER, Integer> createCounterMap(Unit unit) {
    Map<COUNTER, Integer> map = new XLinkedMap<>();
    for (DC_CounterRule rule : unit.getGame().getRules().getCounterRules()) {
        COUNTER c = getCounter(rule.getCounterName());
        Integer n = rule.getNumberOfCounters(unit);
        if (n > 0)
            map.put(c, n);
    }
    return map;
}
Also used : XLinkedMap(main.data.XLinkedMap) COUNTER(main.content.enums.entity.UnitEnums.COUNTER)

Example 17 with XLinkedMap

use of main.data.XLinkedMap in project Eidolons by IDemiurge.

the class UnitGroupMaster method initPool.

private static Map<ObjType, Integer> initPool(ObjType factionType) {
    Map<ObjType, Integer> map = new XLinkedMap<>();
    addUnits(factionType, map, factionType);
    for (String f : StringMaster.open(factionType.getProperty(PROPS.ALLY_FACTIONS))) {
        ObjType allyFactionType = DataManager.getType(f.toString(), MACRO_OBJ_TYPES.FACTIONS);
        addUnits(factionType, map, allyFactionType);
    }
    return map;
}
Also used : ObjType(main.entity.type.ObjType) XLinkedMap(main.data.XLinkedMap)

Example 18 with XLinkedMap

use of main.data.XLinkedMap in project Eidolons by IDemiurge.

the class InitiativePanel method cleanUp.

private void cleanUp() {
    Map<Integer, QueueView> views = new XLinkedMap<>();
    DC_Game.game.getTurnManager().getDisplayedUnitQueue().stream().forEach(unit -> {
        Object o = DungeonScreen.getInstance().getGridPanel().getViewMap().get(unit);
        if (o instanceof GridUnitView) {
            GridUnitView view = ((GridUnitView) o);
            views.put(view.getCurId(), view.getInitiativeQueueUnitView());
        }
    });
    /*
        if unit is unknown/unseen?
        >>
        if unit is unable to act?

        proper cleanup is not done on death(), right?
         */
    for (QueueViewContainer sub : queue) {
        if (sub == null)
            continue;
        if (!views.containsKey(sub.id)) {
            QueueViewContainer view = getIfExists(sub.id);
            if (view == null)
                continue;
            if (view.getActor() == null)
                continue;
            removeView((sub.id));
        }
    }
    // to ensure proper values are displayed
    previewAtbReadiness(null);
}
Also used : QueueView(eidolons.libgdx.bf.grid.QueueView) XLinkedMap(main.data.XLinkedMap) GridUnitView(eidolons.libgdx.bf.grid.GridUnitView)

Example 19 with XLinkedMap

use of main.data.XLinkedMap in project Eidolons by IDemiurge.

the class Loader method getParamsFromNode.

private static Map<PARAMETER, String> getParamsFromNode(String sub) {
    Node node = XML_Converter.findNode(sub, TypeBuilder.PROPS_NODE);
    Map<PARAMETER, String> map = new XLinkedMap<>();
    XML_Converter.getNodeList(node).forEach(subNode -> {
        PARAMETER parameter = ContentManager.getPARAM(subNode.getNodeName());
        String value = subNode.getTextContent();
        map.put(parameter, value);
    });
    return map;
}
Also used : XLinkedMap(main.data.XLinkedMap) Node(org.w3c.dom.Node) PARAMETER(main.content.values.parameters.PARAMETER)

Example 20 with XLinkedMap

use of main.data.XLinkedMap in project Eidolons by IDemiurge.

the class SkirmishMaster method constructWaveSequences.

public static Map<Wave, Integer> constructWaveSequences(Integer round) {
    Map<Wave, Integer> map = new XLinkedMap<>();
    // customize nemesis groups! spawn coordinates - how to specify?
    for (NEMESIS_GROUP g : skirmish.getNemesisGroups()) {
        for (ObjType type : DataManager.getTypesSubGroup(DC_TYPE.ENCOUNTERS, StringMaster.getWellFormattedString(g.toString()))) {
            Wave wave = new Wave(type, DC_Game.game, new Ref(), DC_Game.game.getPlayer(false));
            map.put(wave, round);
        // round += DC_Game.game.getBattleMaster().getBattleConstructor().getRoundsToFight(
        // type);
        // this is just the basic construction - custom waves
        // dungeon-encounters are the way to go then?
        // getSkirmish().getProperty(MACRO_PROPS.CUSTOM_ENCOUNTERS)
        }
    }
    return map;
}
Also used : Wave(eidolons.game.battlecraft.logic.battle.arena.Wave) Ref(main.entity.Ref) ObjType(main.entity.type.ObjType) XLinkedMap(main.data.XLinkedMap)

Aggregations

XLinkedMap (main.data.XLinkedMap)21 ObjType (main.entity.type.ObjType)11 PARAMETER (main.content.values.parameters.PARAMETER)4 Node (org.w3c.dom.Node)4 List (java.util.List)3 PROPERTY (main.content.values.properties.PROPERTY)3 Ref (main.entity.Ref)3 G_Panel (main.swing.generic.components.G_Panel)3 HC_PagedListPanel (eidolons.client.cc.gui.pages.HC_PagedListPanel)2 Wave (eidolons.game.battlecraft.logic.battle.arena.Wave)2 File (java.io.File)2 OBJ_TYPE (main.content.OBJ_TYPE)2 Coordinates (main.game.bf.Coordinates)2 MusicList (main.music.entity.MusicList)2 MusicListPanel (main.music.gui.MusicListPanel)2 Document (org.w3c.dom.Document)2 ClassTreeCondition (eidolons.ability.conditions.req.ClassTreeCondition)1 MultiClassCondition (eidolons.ability.conditions.req.MultiClassCondition)1 SkillPointCondition (eidolons.ability.conditions.req.SkillPointCondition)1 ValueGroupCondition (eidolons.ability.conditions.req.ValueGroupCondition)1