advance method

void advance(
  1. double seconds
)

Implementation

void advance(double seconds) {
  if ((_flags & ActorFlags.isDirty) != 0) {
    const int maxSteps = 100;
    int step = 0;
    int count = _dependencyOrder!.length;
    while ((_flags & ActorFlags.isDirty) != 0 && step < maxSteps) {
      _flags &= ~ActorFlags.isDirty;
      // Track dirt depth here so that if something else marks
      // dirty, we restart.
      for (int i = 0; i < count; i++) {
        ActorComponent component = _dependencyOrder![i]!;
        _dirtDepth = i;
        int d = component.dirtMask;
        if (d == 0) {
          continue;
        }
        component.dirtMask = 0;
        component.update(d);
        if (_dirtDepth < i) {
          break;
        }
      }
      step++;
    }
  }

  if ((_flags & ActorFlags.isDrawOrderDirty) != 0) {
    _flags &= ~ActorFlags.isDrawOrderDirty;
    sortDrawOrder();
  }
}