matches method

bool matches(
  1. UnitType other
)

Implementation

bool matches(UnitType other) {
  return this == other || children.contains(other);
}