Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
MethodCallExpression4.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 private readonly Expression _arg3;
17
18 public override int ArgumentCount => 4;
19
28
29 public override Expression GetArgument(int index)
30 {
31 return index switch
32 {
33 0 => ExpressionUtils.ReturnObject<Expression>(_arg0),
34 1 => _arg1,
35 2 => _arg2,
36 3 => _arg3,
37 _ => throw new ArgumentOutOfRangeException("index"),
38 };
39 }
40
42 {
43 if (arguments != null && arguments.Count == 4)
44 {
46 {
47 return ExpressionUtils.SameElements(arguments, current);
48 }
50 enumerator.MoveNext();
51 if (enumerator.Current == _arg0)
52 {
53 enumerator.MoveNext();
54 if (enumerator.Current == _arg1)
55 {
56 enumerator.MoveNext();
57 if (enumerator.Current == _arg2)
58 {
59 enumerator.MoveNext();
60 return enumerator.Current == _arg3;
61 }
62 }
63 }
64 }
65 return false;
66 }
67
72
74 {
75 if (args != null)
76 {
77 return Expression.Call(base.Method, args[0], args[1], args[2], args[3]);
78 }
79 return Expression.Call(base.Method, ExpressionUtils.ReturnObject<Expression>(_arg0), _arg1, _arg2, _arg3);
80 }
81}
static ReadOnlyCollection< ParameterExpression > ReturnReadOnly(IParameterProvider provider, ref object collection)
static MethodCallExpression Call(MethodInfo method)
override ReadOnlyCollection< Expression > GetOrMakeArguments()
override MethodCallExpression Rewrite(Expression instance, IReadOnlyList< Expression > args)
MethodCallExpression4(MethodInfo method, Expression arg0, Expression arg1, Expression arg2, Expression arg3)
override bool SameArguments(ICollection< Expression > arguments)