Search in sources :

Example 1 with R_get_universe_groups_group_id

use of fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_groups_group_id in project JCELechat by guiguilechat.

the class ShowTank method showGroup.

public static void showGroup(String nameFilter, int... groupIds) {
    // preload the group
    IntStream.of(groupIds).parallel().flatMap(groupId -> IntStream.of(ESIStatic.INSTANCE.cache().universe.groups(groupId).get().types)).forEach(i -> ESIStatic.INSTANCE.cache().universe.types(i));
    System.out.println("name\tid\tgroup\tEMEHP\tTHEHP\tKIEHP\tEXEHP");
    for (int groupId : groupIds) {
        R_get_universe_groups_group_id group = ESIStatic.INSTANCE.cache().universe.groups(groupId).get();
        for (int typeId : group.types) {
            showEntity(nameFilter, typeId);
        }
    }
}
Also used : IntStream(java.util.stream.IntStream) Stream(java.util.stream.Stream) DecimalFormatSymbols(java.text.DecimalFormatSymbols) Locale(java.util.Locale) R_get_universe_types_type_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_types_type_id) Map(java.util.Map) DecimalFormat(java.text.DecimalFormat) fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_dynamic_items_type_id_item_id_dogma_attributes(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_dynamic_items_type_id_item_id_dogma_attributes) ESIStatic(fr.guiguilechat.jcelechat.jcesi.disconnected.ESIStatic) Collectors(java.util.stream.Collectors) R_get_universe_groups_group_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_groups_group_id) R_get_universe_groups_group_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_groups_group_id)

Example 2 with R_get_universe_groups_group_id

use of fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_groups_group_id in project JCELechat by guiguilechat.

the class ShowTank method showEntity.

public static void showEntity(String nameFilter, int typeId) {
    R_get_universe_types_type_id type = ESIStatic.INSTANCE.cache().universe.types(typeId).get();
    if (nameFilter != null && !type.name.matches(nameFilter)) {
        return;
    }
    R_get_universe_groups_group_id group = ESIStatic.INSTANCE.cache().universe.groups(type.group_id).get();
    Map<Integer, Double> attIdToValue = Stream.of(type.dogma_attributes != null ? type.dogma_attributes : new get_dogma_dynamic_items_type_id_item_id_dogma_attributes[0]).collect(Collectors.toMap(att -> att.attribute_id, att -> (double) att.value));
    // shield
    double shieldEMResonnance = attIdToValue.getOrDefault(271, 1.0);
    double shieldTHResonnance = attIdToValue.getOrDefault(274, 1.0);
    double shieldKIResonnance = attIdToValue.getOrDefault(273, 1.0);
    double shieldEXResonnance = attIdToValue.getOrDefault(272, 1.0);
    double shieldHP = attIdToValue.getOrDefault(263, 0.0);
    // armor
    double armorEMResonnance = attIdToValue.getOrDefault(267, 1.0);
    double armorTHResonnance = attIdToValue.getOrDefault(270, 1.0);
    double armorKIResonnance = attIdToValue.getOrDefault(269, 1.0);
    double armorEXResonnance = attIdToValue.getOrDefault(268, 1.0);
    double armorHP = attIdToValue.getOrDefault(265, 0.0);
    // hull
    double hullEMResonnance = attIdToValue.getOrDefault(113, 1.0);
    double hullTHResonnance = attIdToValue.getOrDefault(110, 1.0);
    double hullKIResonnance = attIdToValue.getOrDefault(109, 1.0);
    double hullEXResonnance = attIdToValue.getOrDefault(111, 1.0);
    double hullHP = attIdToValue.getOrDefault(9, 0.0);
    // total ehp
    double EMEHP = shieldHP / shieldEMResonnance + armorHP / armorEMResonnance + hullHP / hullEMResonnance;
    double THEHP = shieldHP / shieldTHResonnance + armorHP / armorTHResonnance + hullHP / hullTHResonnance;
    double KIEHP = shieldHP / shieldKIResonnance + armorHP / armorKIResonnance + hullHP / hullKIResonnance;
    double EXEHP = shieldHP / shieldEXResonnance + armorHP / armorEXResonnance + hullHP / hullEXResonnance;
    System.out.println(type.name + "\t" + typeId + "\t" + group.name + "\t" + nf.format(EMEHP) + "\t" + nf.format(THEHP) + "\t" + nf.format(KIEHP) + "\t" + nf.format(EXEHP));
}
Also used : IntStream(java.util.stream.IntStream) Stream(java.util.stream.Stream) DecimalFormatSymbols(java.text.DecimalFormatSymbols) Locale(java.util.Locale) R_get_universe_types_type_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_types_type_id) Map(java.util.Map) DecimalFormat(java.text.DecimalFormat) fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_dynamic_items_type_id_item_id_dogma_attributes(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_dynamic_items_type_id_item_id_dogma_attributes) ESIStatic(fr.guiguilechat.jcelechat.jcesi.disconnected.ESIStatic) Collectors(java.util.stream.Collectors) R_get_universe_groups_group_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_groups_group_id) R_get_universe_groups_group_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_groups_group_id) R_get_universe_types_type_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_types_type_id)

Example 3 with R_get_universe_groups_group_id

use of fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_groups_group_id in project JCELechat by guiguilechat.

the class ShowAttributes method showEntity.

public static void showEntity(R_get_universe_types_type_id type, String... filters) {
    R_get_universe_groups_group_id group = ESIStatic.INSTANCE.cache().universe.groups(type.group_id).get();
    R_get_universe_categories_category_id cat = ESIStatic.INSTANCE.cache().universe.categories(group.category_id).get();
    System.out.println(type.name + "(" + type.type_id + ") group=" + group.name + "(" + group.group_id + ") category=" + cat.name + "(" + cat.category_id + ")");
    Set<Integer> usedAttIds = new HashSet<>();
    Map<Integer, Float> attIdToValue = Stream.of(type.dogma_attributes != null ? type.dogma_attributes : new get_dogma_dynamic_items_type_id_item_id_dogma_attributes[0]).collect(Collectors.toMap(att -> att.attribute_id, att -> att.value));
    if (type.dogma_effects != null) {
        List<ObjHolder<R_get_dogma_effects_effect_id>> effects = Stream.of(type.dogma_effects).map(eff -> ESIStatic.INSTANCE.cache().dogma.effects(eff.effect_id)).collect(Collectors.toList());
        for (ObjHolder<R_get_dogma_effects_effect_id> h : effects) {
            R_get_dogma_effects_effect_id e = h.get();
            if (filters != null && filters.length != 0) {
                // effect.
                if (Stream.of(filters).filter(filter -> !e.name.toLowerCase().contains(filter.toLowerCase())).findAny().isPresent()) {
                    continue;
                }
            }
            System.out.print("\t" + e.name + "(" + e.effect_id + ")" + "category=" + e.effect_category + " " + e.description);
            List<String> flags = new ArrayList<>();
            if (e.disallow_auto_repeat) {
                flags.add("disallow_auto_repeat");
            }
            if (e.electronic_chance) {
                flags.add("electronic_chance");
            }
            if (e.is_assistance) {
                flags.add("is_assistance");
            }
            if (e.is_offensive) {
                flags.add("is_offensive");
            }
            if (e.is_warp_safe) {
                flags.add("is_warp_safe");
            }
            if (e.range_chance) {
                flags.add("range_chance");
            }
            if (!flags.isEmpty()) {
                System.out.println("[" + flags.stream().collect(Collectors.joining("|")) + "]");
            } else {
                System.out.println();
            }
            if (e.modifiers != null && e.modifiers.length != 0) {
                for (get_dogma_effects_effect_id_modifiers m : e.modifiers) {
                    if (m.modified_attribute_id != 0 && m.modifying_attribute_id != 0) {
                        R_get_dogma_attributes_attribute_id modified = ESIStatic.INSTANCE.cache().dogma.attributes(m.modified_attribute_id).get();
                        usedAttIds.add(m.modifying_attribute_id);
                        System.out.println("\t\t\t" + m.func + " : " + m.domain + "." + modified.display_name + " " + getOperator(m.operator) + " " + getAttValue(attIdToValue, m.modifying_attribute_id));
                    }
                }
            }
            if (e.range_attribute_id != 0) {
                usedAttIds.add(e.range_attribute_id);
                System.out.println("\t\trange(" + e.range_attribute_id + ")=" + printAttValue(attIdToValue, e.range_attribute_id));
            }
            if (e.falloff_attribute_id != 0) {
                usedAttIds.add(e.falloff_attribute_id);
                System.out.println("\t\tfalloff(" + e.falloff_attribute_id + ")=" + printAttValue(attIdToValue, e.falloff_attribute_id));
            }
            if (e.tracking_speed_attribute_id != 0) {
                usedAttIds.add(e.tracking_speed_attribute_id);
                System.out.println("\t\ttracking speed(" + e.tracking_speed_attribute_id + ")=" + printAttValue(attIdToValue, e.tracking_speed_attribute_id));
            }
            if (e.duration_attribute_id != 0) {
                usedAttIds.add(e.duration_attribute_id);
                System.out.println("\t\tduration(" + e.duration_attribute_id + ")=" + printAttValue(attIdToValue, e.duration_attribute_id));
            }
            if (e.discharge_attribute_id != 0) {
                usedAttIds.add(e.discharge_attribute_id);
                System.out.println("\t\tdischarge(" + e.discharge_attribute_id + ")=" + printAttValue(attIdToValue, e.discharge_attribute_id));
            }
            if (e.pre_expression != 0) {
                System.out.println("\t\tpre=" + e.pre_expression);
            }
            if (e.post_expression != 0) {
                System.out.println("\t\tpost=" + e.post_expression);
            }
        }
    }
    if (type.dogma_attributes != null) {
        Stream.of(type.dogma_attributes).sorted((a1, a2) -> a1.attribute_id - a2.attribute_id).parallel().map(att -> {
            R_get_dogma_attributes_attribute_id dogattr = ESIStatic.INSTANCE.cache().dogma.attributes(att.attribute_id).get();
            if (filters != null) {
                for (String filter : filters) {
                    if (filter != null && !dogattr.name.toLowerCase().contains(filter.toLowerCase())) {
                        return null;
                    }
                }
            }
            if (usedAttIds.contains(att.attribute_id)) {
                return null;
            }
            return "\t" + dogattr.name + "(" + att.attribute_id + ")=" + printAttValue(attIdToValue, att.attribute_id);
        }).filter(s -> s != null).forEachOrdered(System.out::println);
    }
}
Also used : IntStream(java.util.stream.IntStream) R_get_dogma_effects_effect_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_dogma_effects_effect_id) ObjHolder(fr.lelouet.tools.holders.interfaces.ObjHolder) R_get_universe_types_type_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_types_type_id) R_get_universe_categories_category_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_categories_category_id) fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_dynamic_items_type_id_item_id_dogma_attributes(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_dynamic_items_type_id_item_id_dogma_attributes) Set(java.util.Set) ESIStatic(fr.guiguilechat.jcelechat.jcesi.disconnected.ESIStatic) fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_effects_effect_id_modifiers(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_effects_effect_id_modifiers) Unit(fr.guiguilechat.jcelechat.model.sde.meta.Unit) Collectors(java.util.stream.Collectors) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) List(java.util.List) Stream(java.util.stream.Stream) Map(java.util.Map) R_get_dogma_attributes_attribute_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_dogma_attributes_attribute_id) R_get_universe_groups_group_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_groups_group_id) R_get_universe_groups_group_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_groups_group_id) ArrayList(java.util.ArrayList) fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_effects_effect_id_modifiers(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_effects_effect_id_modifiers) R_get_dogma_effects_effect_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_dogma_effects_effect_id) R_get_dogma_attributes_attribute_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_dogma_attributes_attribute_id) ObjHolder(fr.lelouet.tools.holders.interfaces.ObjHolder) R_get_universe_categories_category_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_categories_category_id) HashSet(java.util.HashSet)

Example 4 with R_get_universe_groups_group_id

use of fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_groups_group_id in project JCELechat by guiguilechat.

the class ShowAttributes method showGroups.

public static void showGroups(String nameFilter, int... groupids) {
    IntStream.of(groupids).parallel().flatMap(gid -> IntStream.of(ESIStatic.INSTANCE.cache().universe.groups(gid).get().types)).forEach(tid -> ESIStatic.INSTANCE.cache().universe.types(tid));
    for (int groupId : groupids) {
        R_get_universe_groups_group_id group = ESIStatic.INSTANCE.cache().universe.groups(groupId).get();
        for (int typeId : group.types) {
            R_get_universe_types_type_id type = ESIStatic.INSTANCE.cache().universe.types(typeId).get();
            if (nameFilter != null && !type.name.matches(nameFilter)) {
                continue;
            }
            showEntity(type, (String[]) null);
        }
    }
}
Also used : IntStream(java.util.stream.IntStream) R_get_dogma_effects_effect_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_dogma_effects_effect_id) ObjHolder(fr.lelouet.tools.holders.interfaces.ObjHolder) R_get_universe_types_type_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_types_type_id) R_get_universe_categories_category_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_categories_category_id) fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_dynamic_items_type_id_item_id_dogma_attributes(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_dynamic_items_type_id_item_id_dogma_attributes) Set(java.util.Set) ESIStatic(fr.guiguilechat.jcelechat.jcesi.disconnected.ESIStatic) fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_effects_effect_id_modifiers(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_effects_effect_id_modifiers) Unit(fr.guiguilechat.jcelechat.model.sde.meta.Unit) Collectors(java.util.stream.Collectors) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) List(java.util.List) Stream(java.util.stream.Stream) Map(java.util.Map) R_get_dogma_attributes_attribute_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_dogma_attributes_attribute_id) R_get_universe_groups_group_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_groups_group_id) R_get_universe_groups_group_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_groups_group_id) R_get_universe_types_type_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_types_type_id)

Example 5 with R_get_universe_groups_group_id

use of fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_groups_group_id in project JCELechat by guiguilechat.

the class ShowBestKinTankInGroup method showTankGroup.

public static void showTankGroup(int groupId) {
    R_get_universe_groups_group_id group = ESIStatic.INSTANCE.cache().universe.groups(groupId).get();
    System.out.println("group " + group.name);
    Map<R_get_universe_types_type_id, Double> map = IntStream.of(group.types).mapToObj(i -> ESIStatic.INSTANCE.cache().universe.types(i).get()).parallel().collect(Collectors.toMap(entity -> entity, ShowBestKinTankInGroup::getKinEVHPType));
    ArrayList<Entry<R_get_universe_types_type_id, Double>> list = new ArrayList<>(map.entrySet());
    Collections.sort(list, (e1, e2) -> e1.getValue().compareTo(e2.getValue()));
    for (Entry<R_get_universe_types_type_id, Double> e : list) {
        System.out.println("\t" + e.getKey().name + "\t" + e.getValue());
    }
}
Also used : IntStream(java.util.stream.IntStream) R_get_universe_types_type_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_types_type_id) Map(java.util.Map) Entry(java.util.Map.Entry) fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_dynamic_items_type_id_item_id_dogma_attributes(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_dynamic_items_type_id_item_id_dogma_attributes) Collections(java.util.Collections) Collectors(java.util.stream.Collectors) ArrayList(java.util.ArrayList) R_get_universe_groups_group_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_groups_group_id) Entry(java.util.Map.Entry) R_get_universe_groups_group_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_groups_group_id) R_get_universe_types_type_id(fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_types_type_id) ArrayList(java.util.ArrayList)

Aggregations

R_get_universe_groups_group_id (fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_groups_group_id)12 R_get_universe_types_type_id (fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_types_type_id)12 fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_dynamic_items_type_id_item_id_dogma_attributes (fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.get_dogma_dynamic_items_type_id_item_id_dogma_attributes)10 Collectors (java.util.stream.Collectors)8 IntStream (java.util.stream.IntStream)8 ESIStatic (fr.guiguilechat.jcelechat.jcesi.disconnected.ESIStatic)7 R_get_universe_categories_category_id (fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_universe_categories_category_id)7 Map (java.util.Map)7 List (java.util.List)5 Stream (java.util.stream.Stream)5 R_get_dogma_attributes_attribute_id (fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses.R_get_dogma_attributes_attribute_id)4 ObjHolder (fr.lelouet.tools.holders.interfaces.ObjHolder)4 ArrayList (java.util.ArrayList)4 HashSet (java.util.HashSet)4 Collections (java.util.Collections)3 Entry (java.util.Map.Entry)3 Set (java.util.Set)3 ESIAccess (fr.guiguilechat.jcelechat.jcesi.disconnected.modeled.ESIAccess)2 Dogma (fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.disconnected.Dogma)2 Universe (fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.disconnected.Universe)2