private ImpactArea GetImpactArea(IReadOnlyList <Label> labels) { ImpactArea area = ImpactArea.None; foreach (Label label in labels) { if (StringComparer.OrdinalIgnoreCase.Equals(label.Name, Constants.Labels.Client)) { area |= ImpactArea.Client; } if (StringComparer.OrdinalIgnoreCase.Equals(label.Name, Constants.Labels.Mgmt)) { area |= ImpactArea.Mgmt; } if (StringComparer.OrdinalIgnoreCase.Equals(label.Name, Constants.Labels.Service)) { area |= ImpactArea.Service; } if (StringComparer.OrdinalIgnoreCase.Equals(label.Name, Constants.Labels.EngSys)) { area |= ImpactArea.EngSys; } if (StringComparer.OrdinalIgnoreCase.Equals(label.Name, Constants.Labels.MgmtEngSys)) { area |= ImpactArea.MgmtEngSys; } } return(area); }
private async Task HandleEndOfCollisions() { while (Game.IsRunning) { var collision = await ImpactArea.CollisionEnded(); var collider = collision.ColliderA as RigidbodyComponent ?? collision.ColliderB as RigidbodyComponent; _entitiesInRange.Remove(collider); } }
private async Task HandleNewCollisions() { while (Game.IsRunning) { var collision = await ImpactArea.NewCollision(); var collider = collision.ColliderA as RigidbodyComponent ?? collision.ColliderB as RigidbodyComponent; _entitiesInRange.Add(collider); } }
private bool ValidateServiceLabels(Issue issue, StringBuilder problemsWithTheIssue) { // - Service attention requires a service label to be set // - If 'Service' is set, service attention is required ImpactArea impactedArea = GetImpactArea(issue.Labels); // has service attention bool hasServiceAttentionLabel = issue.Labels.Any(i => StringComparer.OrdinalIgnoreCase.Equals(i.Name, Constants.Labels.ServiceAttention)); if (!hasServiceAttentionLabel && impactedArea.HasFlag(ImpactArea.Service)) { problemsWithTheIssue.Append("The Azure SDK team does not own any issues in the Service. "); return(false); } bool hasServiceLabel = issue.Labels.Any(i => i.Color == "e99695" && i.Name != Constants.Labels.ServiceAttention); // check to see if it has a service label if service attention is set if (hasServiceAttentionLabel && !hasServiceLabel) { problemsWithTheIssue.Append("The issue needs a service label. "); return(false); } // check to see if the issue has an ownership (one of Client, Mgmt, Service) if (impactedArea == ImpactArea.None) { problemsWithTheIssue.Append("The issue needs an impacted area (i.e. Client, Mgmt or Service). "); return(false); } // the issue should not have more than 1 type of labels to indicate the type. if ((impactedArea & (impactedArea - 1)) != 0) { problemsWithTheIssue.Append("The impacted area must have just one of the 'Client', 'Mgmt', 'Service', 'EngSys' and 'EngSys-Mgmt' labels. "); return(false); } return(true); }
public static string GetForImpactArea(ImpactArea impactArea) { switch (impactArea) { case ImpactArea.Unknown: return("area:unknown"); case ImpactArea.Sdk: return("area:sdk"); case ImpactArea.Certification: return("area:certification"); case ImpactArea.Tooling: return("area:tooling"); case ImpactArea.Security: return("area:security"); case ImpactArea.ApiEndpoint: return("area:api-endpoint"); case ImpactArea.Feature: return("area:feature"); case ImpactArea.ServiceRuntime: return("area:service-runtime"); case ImpactArea.Region: return("area:region"); case ImpactArea.Sku: return("area:sku"); default: throw new ArgumentOutOfRangeException(nameof(impactArea), impactArea, null); } }