示例#1
0
        /// <summary>
        ///     Add a state declaration node to this compilation unit node.
        /// </summary>
        /// <param name="declaration">The state declaration node to add.</param>
        /// <exception cref="ArgumentNullException">Thrown if the 'declaration' parameter is <c>null</c>.</exception>
        public void Add(LSLStateScopeNode declaration)
        {
            if (declaration == null)
            {
                throw new ArgumentNullException("declaration");
            }

            declaration.Parent = this;

            _addCounter++;
            _stateDeclarations.Add(declaration);
        }
示例#2
0
        /// <summary>
        ///     Construct an <see cref="LSLCompilationUnitNode" /> with the provided default state node.
        /// </summary>
        /// <param name="defaultState">The default state node to use for the default state.</param>
        /// <exception cref="ArgumentNullException"><paramref name="defaultState" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentException"><paramref name="defaultState" />.IsDefaultState is <c>false</c>.</exception>
        public LSLCompilationUnitNode(LSLStateScopeNode defaultState)
        {
            if (defaultState == null)
            {
                throw new ArgumentNullException("defaultState");
            }

            if (!defaultState.IsDefaultState)
            {
                throw new ArgumentException("defaultState.IsDefaultState is false", "defaultState");
            }

            DefaultState = defaultState;

            _comments = new GenericArray <LSLComment>();
        }
 public void SetStateNode(string name, LSLStateScopeNode value)
 {
     _definedStates[name] = value;
 }
示例#4
0
        /// <summary>
        ///     Construct an <see cref="LSLCompilationUnitNode" /> with an empty default state node.
        /// </summary>
        public LSLCompilationUnitNode()
        {
            DefaultState = new LSLStateScopeNode("default");

            _comments = new GenericArray <LSLComment>();
        }