public int Match(WeightedGroupItem item) { if (IsAny) { return Type == item.Type ? 1 : 0; } else { return Name == item.Name ? 2 : 0; } }