Compile Time Changes

MhBayEntryLayout changes

MhBayEntryLayout now takes a list of level entries instead of a single level entry to accomodate of having different level construction entries in the bay layout, such as different unit load.

Old: public MhEngineConstructionEntry levelEntry : deprecated;
New: public MhEngineEntry[] levelsEntries;

We have deprecated getLevelEntry(bool first, bool last) and added a new method getLevelEntry(bool first, bool last, int idx=-1) with a different return type. As a result of both these changes together, calling getLevelEntry(first, last) will now call the newly added method.

We recommend searching for any calls or overrides of getLevelEntry(bool first, bool last) in your extension and updating them to the new interface and return type.

Old:
    /**
     * Get level entry based on symbol.
     */
    extend public MhEngineConstructionEntry getLevelEntry(bool first, bool last) {
        MhEngineConstructionEntry entry;

        if (last) {
            entry = topLevelEntry;
        } else if (first) {
            entry = botLevelEntry;
        } else {
            entry = levelEntry;
        }

        return entry;
    }


New:
    /**
     * Get level entry based on symbol.
     */
    extend public MhEngineConstructionEntry getLevelEntry(bool first, bool last) : deprecated {
        return getLevelEntry(.., idx=-1).MhEngineConstructionEntry;
    }


    /**
     * Get level entry based on symbol.
     */
    extend public MhEngineEntry getLevelEntry(bool first, bool last, int idx=-1) {
        if (last) return topLevelEntry;
        else if (first) return botLevelEntry;
        else if (levelEntry) return levelEntry;
        else if (levelsEntries.count > idx and idx >= 0) return levelsEntries[idx];
        else return levelsEntries.last;
        return null;
    }

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

Pick up and apply row animation

During pick up and apply row animation within the same system, the picked up row relative position to the system will also get applied over.

    /**
     * Apply picked up snappers.
     */
    extend public void applyPickedUpSnappers(Snapper[] groupSnappers,
					     Snapper firstS, Snapper first,
					     box oldBound,
					     bool needToRotateChildren) {
        ...
		    point xOffset();
		    if (copyPickedUpXPos) xOffset.x -= c.toSnapper(first.pos).x;
		    point newPos = first.toSpace(oldBound.p0 + vOffset + xOffset);
		    cs.setPos(newPos);
        ...
    }

MhRowExportFunction changes

During spawnSnapper(MhEngineConstructionEntry entry, str key, bool &cached), if assortment's userMainAssortmentConfig flag is true, then we override the spawner config with the assortment config.

Old:
        s = entry.spawnSnapper(engine.MhEngine, assortment.spawnerSelector(assortClassi));
New:
        MhSystemSpawnerSelector ss = assortment.spawnerSelector(assortClassi);
        ?MhStorageSpawner spawner = ss.spawner(entry.classification);
        MhStorageConfiguration oldConfig = spawner.overrideConfig;
        if (assortment.useMainAssortmentConfig) ?spawner.overrideConfig = assortment.configuration;
        
        s = entry.spawnSnapper(engine.MhEngine, ss);
        
        if (assortment.useMainAssortmentConfig) spawner.overrideConfig = oldConfig;

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