incrementCtr method

void incrementCtr (
  1. MissileSite sm
)

This is called when the timer expires.

If the MissileSite is still in a distressed state we restart the timer.

We then create a proposal for a MS.saFlash which will end up with saFlash being invoked inside the SamModel.present execution scope.

Code is simplified here (and other places) because Dart closures allow us to pass object instances directly (sm) , not a symbolic reference to them.

Implementation

void incrementCtr(MissileSite sm) {
  if (sm.samState == "${MS.ssDistressed}") sm._timer.reset();
  sm.presentNow(MS.saFlash);
  //assert(log("_incrementCtr ${sm.getHot('distressedCtr')}"));
}