Rule constructor

Rule({
  1. String? cat,
  2. required ZoomlevelRange zoomlevelRange,
  3. required List<Rule> subRules,
  4. required List<RenderinstructionNode> renderinstructionNodes,
  5. required List<RenderinstructionWay> renderinstructionOpenWays,
  6. required List<RenderinstructionWay> renderinstructionClosedWays,
})

Implementation

Rule({
  this.cat,
  required this.zoomlevelRange,
  required this.subRules,
  required this.renderinstructionNodes,
  required this.renderinstructionOpenWays,
  required this.renderinstructionClosedWays,
}) : assert(
       subRules.isNotEmpty ||
           (subRules.isEmpty && (renderinstructionNodes.isNotEmpty || renderinstructionOpenWays.isNotEmpty || renderinstructionClosedWays.isNotEmpty)),
     ) {
  for (var rule in subRules) {
    rule.parent = this;
  }
}