// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AutomationTool
{
///
/// Which changelist to show a UGS badge for
///
enum LabelChange
{
///
/// The current changelist being built
///
Current,
///
/// The last code changelist
///
Code,
}
///
/// Defines a label within a graph. Labels are similar to badges, and give the combined status of one or more job steps. Unlike badges, they
/// separate the requirements for its status and optional nodes to be included in its status, allowing this to be handled externally.
///
class Label
{
///
/// Name of this badge
///
public readonly string DashboardName;
///
/// Category for this label
///
public readonly string DashboardCategory;
///
/// Name of the badge in UGS
///
public readonly string UgsBadge;
///
/// Path to the project folder in UGS
///
public readonly string UgsProject;
///
/// Which change to show the badge for
///
public readonly LabelChange Change;
///
/// Set of nodes that must be run for this label to be shown.
///
public HashSet RequiredNodes = new HashSet();
///
/// Set of nodes that will be included in this label if present.
///
public HashSet IncludedNodes = new HashSet();
///
/// Constructor
///
/// Name of this label
/// Type of this label
/// The UGS badge name
/// Project to display this badge for
/// The change to show this badge on in UGS
public Label(string InDashboardName, string InDashboardCategory, string InUgsBadge, string InUgsProject, LabelChange InChange)
{
DashboardName = InDashboardName;
DashboardCategory = InDashboardCategory;
UgsBadge = InUgsBadge;
UgsProject = InUgsProject;
Change = InChange;
}
///
/// Get the name of this label
///
/// The name of this label
public override string ToString()
{
if (!String.IsNullOrEmpty(DashboardName))
{
return String.Format("{0}/{1}", DashboardCategory, DashboardName);
}
else
{
return UgsBadge;
}
}
}
}