buildSamModel function

SamModel buildSamModel (
  1. SamFactory sf,
  2. SamModel sm,
  3. {SamModel parent}
)

Builds the SamModel from the SamFactory that has formatted the SamAction, SamState and SamView instances.

The SamModel.makeModel method is called to allow the SamModel instance to be customized.

Implementation

SamModel buildSamModel(SamFactory sf,SamModel sm,{SamModel parent}) {
  sm._sa = sf._sa;
  sm._ss = sf._ss;
  sm._sv = sf._sv;
  sm._parent = parent;
  if (parent != null) {
    if (parent._kids == null) parent._kids = [];
    parent._kids.add(sm);
  }
  sm._enums = sf.enums;
  sm._enumTypes = sf.enumTypes;
  sm.makeModel(sf,sm._sa,sm._ss,sm._sv);
  return sm;
}