You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
2.3 KiB
57 lines
2.3 KiB
using System; |
|
using static gaemstone.Flecs.Core; |
|
|
|
namespace gaemstone.ECS; |
|
|
|
/// <summary> |
|
/// <p> |
|
/// Components marked with this attribute are automatically registered with |
|
/// a <see cref="EntityRef.Symbol"/> equal to their <see cref="EntityRef.Name"/>. |
|
/// Symbols are unique string identifiers used to look up their entities. |
|
/// </p> |
|
/// <p> |
|
/// Modules marked with this attribute apply this property to all their |
|
/// components, except ones marked with <see cref="PrivateAttribute"/>. |
|
/// </p> |
|
/// </summary> |
|
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
|
| AttributeTargets.Enum | AttributeTargets.Method)] |
|
public class PublicAttribute : Attribute { } |
|
|
|
/// <seealso cref="PublicAttribute"/> |
|
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
|
| AttributeTargets.Enum | AttributeTargets.Method)] |
|
public class PrivateAttribute : Attribute { } |
|
|
|
|
|
// TODO: Should this be renamed from [Add<...>] to something else? |
|
/// <summary> |
|
/// Marked entity automatically has the specified entity added to it when |
|
/// automatically registered. Equivalent to <see cref="EntityBuilder.Add{T}"/>. |
|
/// </summary> |
|
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
|
| AttributeTargets.Enum | AttributeTargets.Method, |
|
AllowMultiple = true)] |
|
public class AddAttribute<TEntity> : Attribute { } |
|
|
|
/// <summary> |
|
/// Marked entity automatically has the specified relationship pair added to it when |
|
/// automatically registered. Equivalent to <see cref="EntityBuilder.Add{TRelation, TTarget}"/>. |
|
/// </summary> |
|
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
|
| AttributeTargets.Enum | AttributeTargets.Method, |
|
AllowMultiple = true)] |
|
public class AddAttribute<TRelation, TTarget> : Attribute { } |
|
|
|
|
|
/// <seealso cref="IsA"/> |
|
public class IsAAttribute<TTarget> : AddAttribute<IsA, TTarget> { } |
|
/// <seealso cref="ChildOf"/> |
|
public class ChildOfAttribute<TTarget> : AddAttribute<ChildOf, TTarget> { } |
|
/// <seealso cref="DependsOn"/> |
|
public class DependsOnAttribute<TTarget> : AddAttribute<DependsOn, TTarget> { } |
|
|
|
/// <seealso cref="Exclusive"/> |
|
public class ExclusiveAttribute : AddAttribute<Exclusive> { } |
|
/// <seealso cref="With"/> |
|
public class WithAttribute<TTarget> : AddAttribute<With, TTarget> { }
|
|
|