Search in sources :

Example 1 with COUNTER_INTERACTION

use of main.content.enums.entity.UnitEnums.COUNTER_INTERACTION in project Eidolons by IDemiurge.

the class CounterMasterAdvanced method afterRoundEnds.

public static void afterRoundEnds(Unit unit) {
    // some interactions should happen immediately - e.g. moist vs blaze
    // so we need to Interact, Convert and Transfer... what's the order? probably exactly that!
    Map<COUNTER, Integer> map = createCounterMap(unit);
    map.forEach((counter, value) -> map.forEach((counter2, value2) -> {
        if (counter != counter2) {
            COUNTER_INTERACTION interaction = getInteraction(counter, counter2);
            int max = getMaxInteractionValue(unit, counter, counter2, value, value2);
            interact(counter, counter2, interaction, max, unit);
        }
    }));
    Map<COUNTER, Integer> convertMap = createCounterMap(unit);
    map.forEach((counter, value) -> {
        COUNTER counter2 = getConvertion(counter);
        int max = getMaxConvertionValue(unit, counter, counter2, value);
        convertCounters(counter, counter2, max, unit);
    });
    Map<COUNTER, Integer> transferMap = createCounterMap(unit);
    map.forEach((counter, value) -> map.forEach((counter2, value2) -> {
        if (counter != counter2) {
            COUNTER_INTERACTION interaction = getInteraction(counter, counter2);
            int max = getMaxInteractionValue(unit, counter, counter2, value, value2);
            interact(counter, counter2, interaction, max, unit);
        }
    }));
}
Also used : COUNTER_INTERACTION(main.content.enums.entity.UnitEnums.COUNTER_INTERACTION) COUNTER_OPERATION(main.content.enums.entity.UnitEnums.COUNTER_OPERATION) COUNTER(main.content.enums.entity.UnitEnums.COUNTER) Map(java.util.Map) XLinkedMap(main.data.XLinkedMap) HashMap(java.util.HashMap) Unit(eidolons.entity.obj.unit.Unit) CounterMaster(main.system.entity.CounterMaster) COUNTER_INTERACTION(main.content.enums.entity.UnitEnums.COUNTER_INTERACTION) COUNTER(main.content.enums.entity.UnitEnums.COUNTER)

Aggregations

Unit (eidolons.entity.obj.unit.Unit)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 COUNTER (main.content.enums.entity.UnitEnums.COUNTER)1 COUNTER_INTERACTION (main.content.enums.entity.UnitEnums.COUNTER_INTERACTION)1 COUNTER_OPERATION (main.content.enums.entity.UnitEnums.COUNTER_OPERATION)1 XLinkedMap (main.data.XLinkedMap)1 CounterMaster (main.system.entity.CounterMaster)1