Skip to content
  • Philip Levis's avatar
    Significant resdesign of the data model to allow wings to move. · 3dbb309c
    Philip Levis authored
    This was necessary to be able to support moving the wings
    The prior approach was relying on static variables in order to
    invoke the super() constructor of LXModel in LXModel subclasses.
    The constructor takes the sub-models. This is a problem if you want
    to build top down (create a Flight, whcih creates Flyers, which
    creates Wings, which creates Points), as the lower level has to
    exist when you instantiated the higher one. That is, to call
    
    super(LXModel[] children)
    
    in the WingModel, for example, you need all of the children
    models created already. But you are in the first line of the
    constructor, so it is hard to do so. The prior design relied
    on static variables to achieve this, but this as the problem
    that then every Flyer has the same wings -- you can't move them
    individually (since Wings are static variables).
    
    This PR refactors the data model so it's built bottom up. THis
    happens in Model. First it builds the LightPoints, then the
    Wings, then the Flyers, then the Flight.
    
    The Fade test pattern now also moves the wings. Take a look.
    3dbb309c