Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Block4.cs
Go to the documentation of this file.
4
6
7internal sealed class Block4 : BlockExpression
8{
9 private object _arg0;
10
11 private readonly Expression _arg1;
12
13 private readonly Expression _arg2;
14
15 private readonly Expression _arg3;
16
17 internal override int ExpressionCount => 4;
18
26
28 {
29 if (expressions.Count == 4)
30 {
32 {
33 return ExpressionUtils.SameElements(expressions, current);
34 }
36 enumerator.MoveNext();
37 if (enumerator.Current == _arg0)
38 {
39 enumerator.MoveNext();
40 if (enumerator.Current == _arg1)
41 {
42 enumerator.MoveNext();
43 if (enumerator.Current == _arg2)
44 {
45 enumerator.MoveNext();
46 return enumerator.Current == _arg3;
47 }
48 }
49 }
50 }
51 return false;
52 }
53
54 internal override Expression GetExpression(int index)
55 {
56 return index switch
57 {
58 0 => ExpressionUtils.ReturnObject<Expression>(_arg0),
59 1 => _arg1,
60 2 => _arg2,
61 3 => _arg3,
62 _ => throw Error.ArgumentOutOfRange("index"),
63 };
64 }
65
70
72 {
73 return new Block4(args[0], args[1], args[2], args[3]);
74 }
75}
readonly Expression _arg2
Definition Block4.cs:13
readonly Expression _arg1
Definition Block4.cs:11
Block4(Expression arg0, Expression arg1, Expression arg2, Expression arg3)
Definition Block4.cs:19
override ReadOnlyCollection< Expression > GetOrMakeExpressions()
Definition Block4.cs:66
override bool SameExpressions(ICollection< Expression > expressions)
Definition Block4.cs:27
override int ExpressionCount
Definition Block4.cs:17
override BlockExpression Rewrite(ReadOnlyCollection< ParameterExpression > variables, Expression[] args)
Definition Block4.cs:71
readonly Expression _arg3
Definition Block4.cs:15
override Expression GetExpression(int index)
Definition Block4.cs:54
static ReadOnlyCollection< Expression > ReturnReadOnlyExpressions(BlockExpression provider, ref object collection)
static Exception ArgumentOutOfRange(string paramName)
Definition Error.cs:818