Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
PropertyByRefUpdater.cs
Go to the documentation of this file.
3
5
6internal sealed class PropertyByRefUpdater : ByRefUpdater
7{
8 private readonly LocalDefinition? _object;
9
10 private readonly PropertyInfo _property;
11
12 public PropertyByRefUpdater(LocalDefinition? obj, PropertyInfo property, int argumentIndex)
13 : base(argumentIndex)
14 {
15 _object = obj;
16 _property = property;
17 }
18
19 public override void Update(InterpretedFrame frame, object value)
20 {
21 object obj = ((!_object.HasValue) ? null : frame.Data[_object.GetValueOrDefault().Index]);
22 try
23 {
25 }
27 {
30 }
31 }
32
33 public override void UndefineTemps(InstructionList instructions, LocalVariables locals)
34 {
35 if (_object.HasValue)
36 {
37 locals.UndefineLocal(_object.GetValueOrDefault(), instructions.Count);
38 }
39 }
40}
static void UnwrapAndRethrow(TargetInvocationException exception)
void UndefineLocal(LocalDefinition definition, int end)
override void UndefineTemps(InstructionList instructions, LocalVariables locals)
PropertyByRefUpdater(LocalDefinition? obj, PropertyInfo property, int argumentIndex)
override void Update(InterpretedFrame frame, object value)
void SetValue(object? obj, object? value)