-
Notifications
You must be signed in to change notification settings - Fork 450
Expand file tree
/
Copy pathLuaAttributes.cs
More file actions
57 lines (48 loc) · 1.76 KB
/
LuaAttributes.cs
File metadata and controls
57 lines (48 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
namespace BizHawk.Client.Common
{
[AttributeUsage(AttributeTargets.Parameter)]
public sealed class LuaColorParamAttribute : Attribute {}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
public sealed class LuaDeprecatedMethodAttribute : Attribute {}
[AttributeUsage(AttributeTargets.Method)]
public sealed class LuaMethodAttribute : Attribute
{
public LuaMethodAttribute(string name, string description)
{
Name = name;
Description = description;
}
public string Name { get; }
public string Description { get; }
}
[AttributeUsage(AttributeTargets.Method)]
public sealed class LuaMethodExampleAttribute : Attribute
{
public LuaMethodExampleAttribute(string example)
=> Example = example.ReplaceLineEndings();
public string Example { get; }
}
[AttributeUsage(AttributeTargets.Class)]
public sealed class LuaLibraryAttribute : Attribute
{
public LuaLibraryAttribute(bool released)
{
Released = released;
}
public bool Released { get; }
}
/// <summary>
/// Marks table return values that are indexed starting from zero, for documentation purposes only.
/// </summary>
[AttributeUsage(AttributeTargets.ReturnValue | AttributeTargets.Parameter)]
public sealed class LuaZeroIndexedAttribute : Attribute { }
/// <summary>
/// Specifies a custom type to be used in LuaCATS annotations, for documentation purposes only.
/// See <see cref="LuaCatsGenerator.Classes" /> and <see href="https://luals.github.io/wiki/annotations/#documenting-types" /> for possible values.
/// </summary>
[AttributeUsage(AttributeTargets.ReturnValue | AttributeTargets.Parameter)]
public sealed class LuaCatsTypeAttribute(string Type) : Attribute
{
public string Type { get; } = Type;
}
}