yyl
7 天以前 c124d98bdf9659cf764bebb799bee42c30eb152f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace Jace.Operations
{
    public class Function : Operation
    {
        private IList<Operation> arguments;
 
        public Function(DataType dataType, string functionName, IList<Operation> arguments, bool isIdempotent)
            : base(dataType, arguments.FirstOrDefault(o => o.DependsOnVariables) != null, isIdempotent && arguments.All(o => o.IsIdempotent))
        {
            this.FunctionName = functionName;
            this.arguments = arguments;
        }
 
        public string FunctionName { get; private set; }
 
        public IList<Operation> Arguments {
            get
            {
                return arguments;
            }
            internal set
            {
                this.arguments = value;
                this.DependsOnVariables = arguments.FirstOrDefault(o => o.DependsOnVariables) != null;
            }
        }
    }
}