using System;
using System.Linq;
using System.Reflection;
using Robust.Shared.Utility;
namespace Robust.Shared.ViewVariables
{
public static class ViewVariablesUtility
{
///
/// Check whether this type has any fields or properties with the ,
/// i.e. whether there are any members that are visible in a VV window.
///
///
/// This is quite an expensive operation, don't use it lightly.
///
/// The type to check.
/// True if there are members with the attribute, false otherwise.
public static bool TypeHasVisibleMembers(Type type)
{
return type.GetAllFields().Cast().Concat(type.GetAllProperties())
.Any(f => f.GetCustomAttribute() != null);
}
}
}