Files
sbox-public/engine/Sandbox.System/Attributes/LibraryAttribute.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

56 lines
1.4 KiB
C#

using Sandbox.Internal;
namespace Sandbox
{
[AttributeUsage( AttributeTargets.Class )]
public class LibraryAttribute : System.Attribute, ITitleProvider, IDescriptionProvider, IClassNameProvider, IUninheritable
{
string Internal.ITitleProvider.Value => Title;
string Internal.IDescriptionProvider.Value => Description;
string Internal.IClassNameProvider.Value => Name;
/// <summary>
/// This is the name that will be used to create this class.
/// If you don't set it via the attribute constructor it will be set
/// to the name of the class it's attached to
/// </summary>
public string Name { get; internal set; }
/// <summary>
/// The full class name
/// </summary>
public string FullName { get; internal set; }
/// <summary>
/// A nice presentable name to show
/// </summary>
public string Title { get; set; }
/// <summary>
/// We use this to provide a nice description in the editor
/// </summary>
public string Description { get; set; }
/// <summary>
/// We use this to organize groups of entities in the editor
/// </summary>
public string Group { get; set; }
/// <summary>
/// We use this to filter entities to show in the entity list in the editor
/// </summary>
public bool Editable { get; set; }
public LibraryAttribute()
{
}
public LibraryAttribute( string name )
{
Name = name;
}
}
}