Compile Time Changes

Deprecate mhCalculatedBayHeight

- Deprecated: public <double, int, double> mhCalculatedBayHeight(MhSystemConfigurationItem this, MhSnapper bay, int stepCount,
                                                   bool loadWithinLimit=false,
                                                   SnapperFilter filter=mhBayChildrenFilter,
                                                   double maxBayHeight=maxDouble, bool xtrace=false) {
                                                   double maxBayHeight=maxDouble, bool xtrace=false) : deprecated {

This function is no longer needed. It has grown so huge, and very patchy. All instances that call this function should be replaced.

MhBaySizeEditorItem change

Old:
            return mhCalculatedBayHeight(bay, stepCount=stepCount,
                                         loadWithinLimit=loadWithinBayLimit(),
                                         maxBayHeight=maxBayHeight, xtrace=xtrace);

new:
            double h = mhCalculatedBayHeight(bay, stepCount, loadWithinLimit=loadWithinBayLimit());
            return <h, stepCount, 0d>;

Instead of using the mhCalculatedBayHeight() to calculate new bay height at the function calculatedBayHeight(), we replace it with a similar method, mhCalculatedBayHeight(MhSystemConfigurationItem this, MhSnapper bay, int stepCount, bool loadWithinLimit=false), which uses bruteforce to calculate bay height.

MhBayConfigurationItem change

Old: max = mhCalculatedBayHeight(getBay(), max, maxBayHeight=maxBayH).v1;
New: max = mhCalculatedMaxLevelCount(bay);

Instead of using mhCalculatedBayHeight() to calculate number of levels domain at the function numLevelsDomain(), we use mhCalculatedMaxLevelCount().

Runtime/Behavior Changes

MhLevelArrangeFunction2 changes

MhLevelArrangeFunction2.arrangeLevelsSteps(MhPopulator populator, MhEngineEntry[] processedEntries) has been updated so that when there is a collision, instead of just moving the next level above, it will now move all subsequent levels above.

/**
 * Level Arrange engine (ensure clearance between levels).
 */
public class MhLevelArrangeFunction2 extends MhSystemEngineFunction {

Old:
    /**
     * Arrange levels by stepping through populator.
     */
    extend public void arrangeLevelsSteps(MhPopulator populator, MhEngineEntry[] processedEntries) {
        ...
                if (!ar and more and MhEngineEntry next = processedEntries[i + 1]) {
                    if (next.pos.z < e.pos.z) next.move(v);
                }
        ...
    }


New:
    /**
     * Arrange levels by stepping through populator.
     */
    extend public void arrangeLevelsSteps(MhPopulator populator, MhEngineEntry[] processedEntries) {
        ...
                if (!ar and more and v.z > 0) {
                    int nextIdx = i;
                    while (processedEntries.count > ++nextIdx and
                           (MhEngineEntry next = processedEntries[nextIdx]) and
                           (MhEngineEntry prev = processedEntries[nextIdx - 1])) {
                        if (next.pos.z < prev.pos.z) {
                            next.move(v);
                        }
                    }
                }
        ...
    }