cm.abstract.materialHandling

MhEngineEntryBase changes

Deprecated the following and replaced with a new method. This is so that an Object arg can be passed into sortFunc.

Deprecated: extend public MhEngineEntry[] sortedChildren(MhEngine engine, function(MhEngineEntry, MhEngineEntry, Object):int sortFunc) : deprecated {
New: extend public MhEngineEntry[] sortedChildren(MhEngine engine, function(MhEngineEntry, MhEngineEntry, Object):int sortFunc, Object arg=null) {

MhEngineConstructionEntry changes

Now MhEngineConstructionEntry has a field assortmentClassification, determining which assortment this entry comes from and belongs to.

Added: public LayerSet assortmentClassification : copy=reference;
Added: extend public LayerSet assortmentClassification() {
Added: extend public LayerSet assortmentClassification=(LayerSet a) {

Thus, exporting entry now at MhRowExportFunction will check for the entry assortmentClassification, to get the correct spawner selector and assortment.

Old: 
    s = entry.spawnSnapper(engine.MhEngine, getSpawnerSelector());
New: 
        LayerSet assortClassi = entry.assortmentClassification;
        if (assortClassi) s = entry.spawnSnapper(engine.MhEngine, assortment.spawnerSelector(assortClassi));
        else s = entry.spawnSnapper(engine.MhEngine, configuration.spawnerSelector);

Add assortmentClassification as an argument on the constructors.

Old: public constructor(box b, Transform t, LayerSet classification=null) : deprecated {
Old: public constructor(box b, LayerSet classification) : deprecated {
New: public constructor(box b, Transform t, LayerSet classification=null, LayerSet assortClassification=null) {
New: public constructor(box b, LayerSet classification, LayerSet assortClassification=null) {

Therefore, all MhEngineConstructionEntry instantiations now pass in the assortment's classification as an argument.

cm.abstract.materialHandling.storage

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().

cm.abstract.unitLoad

UnitLoadDialog apply unit load changes

Deprecated the following and replaced with a new method. The deprecated method would loop through and gather all Snappers in mainWorld that use a unit load. This was too broad for the intention of the method and would gather significantly more snappers than required. The new method will gather all Snappers in mainWorld that use one of the unit load objects passed in as an argument.

Deprecated: extend public CoreObject{} getAffectedObjects() : deprecated {
New: extend public CoreObject{} getAffectedObjects(UnitLoad[] unitLoads) {

Similarly, we have deprecated and replaced the following method as well for the same reason.

Deprecated: extend public bool hasLoad(CoreObject obj) : deprecated {
New: extend public bool usesLoad(CoreObject obj, UnitLoad[] unitLoads) {

The method applyAllCallback(UnitLoad[] applyUnitLoads) has been updated to use the new method getAffectedObjects(UnitLoad[] unitLoads) so if you have overridden it, check if you need to update your method call as well.