// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
namespace FlaxEditor.Content.Settings
{
///
/// A game building preset with set of build targets.
///
[Serializable]
public class BuildPreset
{
///
/// The name of the preset.
///
[EditorOrder(10), Tooltip("Name of the preset")]
public string Name;
///
/// The target configurations.
///
[EditorOrder(20), Tooltip("Target configurations")]
public BuildTarget[] Targets;
///
/// Gets the target of the given name (ignore case search) or returns null if cannot find it.
///
/// The target name.
/// Found target or null if is missing.
public BuildTarget GetTarget(string name)
{
if (Targets != null)
{
for (int i = 0; i < Targets.Length; i++)
{
if (string.Equals(Targets[i].Name, name, StringComparison.OrdinalIgnoreCase))
return Targets[i];
}
}
return null;
}
}
}