// Copyright Epic Games, Inc. All Rights Reserved.
namespace EpicGames.BuildGraph.Expressions
{
///
/// Specification for a label
///
public class BgLabel : BgExpr
{
///
/// Name of this badge
///
public BgString? DashboardName { get; }
///
/// Category for this label
///
public BgString? DashboardCategory { get; }
///
/// Name of the badge in UGS
///
public BgString? UgsBadge { get; }
///
/// Path to the project folder in UGS
///
public BgString? UgsProject { get; }
///
/// Which change to show the badge for
///
public BgEnum? Change { get; }
///
/// Constructor
///
public BgLabel(BgString? name = null, BgString? category = null, BgString? ugsBadge = null, BgString? ugsProject = null, BgEnum? change = null)
: base(BgExprFlags.ForceFragment)
{
DashboardName = name;
DashboardCategory = category;
UgsBadge = ugsBadge;
UgsProject = ugsProject;
Change = change;
}
///
public override void Write(BgBytecodeWriter writer)
{
BgObject obj = BgObject.Empty;
if (DashboardName is not null)
{
obj = obj.Set(x => x.DashboardName, DashboardName);
}
if (DashboardCategory is not null)
{
obj = obj.Set(x => x.DashboardCategory, DashboardCategory);
}
if (UgsBadge is not null)
{
obj = obj.Set(x => x.UgsBadge, UgsBadge);
}
if (UgsProject is not null)
{
obj = obj.Set(x => x.UgsProject, UgsProject);
}
if (Change is not null)
{
obj = obj.Set(x => x.Change, Change);
}
writer.WriteExpr(obj);
}
///
public override BgString ToBgString() => "{Label}";
}
}