Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EventDefinition.cs
Go to the documentation of this file.
2
4
5public readonly struct EventDefinition
6{
7 private readonly MetadataReader _reader;
8
9 private readonly int _rowId;
10
12
14
16
17 public EntityHandle Type => _reader.EventTable.GetEventType(Handle);
18
20 {
21 _reader = reader;
22 _rowId = handle.RowId;
23 }
24
29
31 {
32 int adderRowId = 0;
33 int removerRowId = 0;
34 int raiserRowId = 0;
36 ushort methodCount;
37 int num = _reader.MethodSemanticsTable.FindSemanticMethodsForEvent(Handle, out methodCount);
38 for (ushort num2 = 0; num2 < methodCount; num2++)
39 {
40 int rowId = num + num2;
41 switch (_reader.MethodSemanticsTable.GetSemantics(rowId))
42 {
44 adderRowId = _reader.MethodSemanticsTable.GetMethod(rowId).RowId;
45 break;
46 case MethodSemanticsAttributes.Remover:
47 removerRowId = _reader.MethodSemanticsTable.GetMethod(rowId).RowId;
48 break;
49 case MethodSemanticsAttributes.Raiser:
50 raiserRowId = _reader.MethodSemanticsTable.GetMethod(rowId).RowId;
51 break;
53 if (builder == null)
54 {
55 builder = ImmutableArray.CreateBuilder<MethodDefinitionHandle>();
56 }
57 builder.Add(_reader.MethodSemanticsTable.GetMethod(rowId));
58 break;
59 }
60 }
62 return new EventAccessors(adderRowId, removerRowId, raiserRowId, others);
63 }
64}
static readonly ImmutableArray< T > Empty
MethodSemanticsTableReader MethodSemanticsTable
static EventDefinitionHandle FromRowId(int rowId)
CustomAttributeHandleCollection GetCustomAttributes()
EventDefinition(MetadataReader reader, EventDefinitionHandle handle)