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