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;
}
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;
}
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);
}
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;
}
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;
}
Aggregations