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