Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Scope1.cs
Go to the documentation of this file.
4
6
7internal sealed class Scope1 : ScopeExpression
8{
9 private object _body;
10
11 internal override int ExpressionCount => 1;
12
14 : this(variables, (object)body)
15 {
16 }
17
20 {
21 _body = body;
22 }
23
25 {
26 if (expressions.Count == 1)
27 {
29 {
30 return ExpressionUtils.SameElements(expressions, current);
31 }
33 enumerator.MoveNext();
34 return ExpressionUtils.ReturnObject<Expression>(_body) == enumerator.Current;
35 }
36 return false;
37 }
38
39 internal override Expression GetExpression(int index)
40 {
41 if (index == 0)
42 {
43 return ExpressionUtils.ReturnObject<Expression>(_body);
44 }
45 throw Error.ArgumentOutOfRange("index");
46 }
47
52
54 {
55 if (args == null)
56 {
58 return new Scope1(variables, _body);
59 }
61 }
62}
static ReadOnlyCollection< Expression > ReturnReadOnlyExpressions(BlockExpression provider, ref object collection)
static Exception ArgumentOutOfRange(string paramName)
Definition Error.cs:818
static void ValidateVariables(ReadOnlyCollection< ParameterExpression > varList, string collectionName)
Scope1(IReadOnlyList< ParameterExpression > variables, object body)
Definition Scope1.cs:18
Scope1(IReadOnlyList< ParameterExpression > variables, Expression body)
Definition Scope1.cs:13
override bool SameExpressions(ICollection< Expression > expressions)
Definition Scope1.cs:24
override int ExpressionCount
Definition Scope1.cs:11
override Expression GetExpression(int index)
Definition Scope1.cs:39
override ReadOnlyCollection< Expression > GetOrMakeExpressions()
Definition Scope1.cs:48
override BlockExpression Rewrite(ReadOnlyCollection< ParameterExpression > variables, Expression[] args)
Definition Scope1.cs:53
IReadOnlyList< ParameterExpression > ReuseOrValidateVariables(ReadOnlyCollection< ParameterExpression > variables)