Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
MethodCallExpression3.cs
Go to the documentation of this file.
5
7
9{
10 private object _arg0;
11
12 private readonly Expression _arg1;
13
14 private readonly Expression _arg2;
15
16 public override int ArgumentCount => 3;
17
25
26 public override Expression GetArgument(int index)
27 {
28 return index switch
29 {
30 0 => ExpressionUtils.ReturnObject<Expression>(_arg0),
31 1 => _arg1,
32 2 => _arg2,
33 _ => throw new ArgumentOutOfRangeException("index"),
34 };
35 }
36
38 {
39 if (arguments != null && arguments.Count == 3)
40 {
42 {
43 return ExpressionUtils.SameElements(arguments, current);
44 }
46 enumerator.MoveNext();
47 if (enumerator.Current == _arg0)
48 {
49 enumerator.MoveNext();
50 if (enumerator.Current == _arg1)
51 {
52 enumerator.MoveNext();
53 return enumerator.Current == _arg2;
54 }
55 }
56 }
57 return false;
58 }
59
64
66 {
67 if (args != null)
68 {
69 return Expression.Call(base.Method, args[0], args[1], args[2]);
70 }
71 return Expression.Call(base.Method, ExpressionUtils.ReturnObject<Expression>(_arg0), _arg1, _arg2);
72 }
73}
static ReadOnlyCollection< ParameterExpression > ReturnReadOnly(IParameterProvider provider, ref object collection)
static MethodCallExpression Call(MethodInfo method)
override ReadOnlyCollection< Expression > GetOrMakeArguments()
override bool SameArguments(ICollection< Expression > arguments)
override MethodCallExpression Rewrite(Expression instance, IReadOnlyList< Expression > args)
MethodCallExpression3(MethodInfo method, Expression arg0, Expression arg1, Expression arg2)