Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
NamespaceBlock.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System.Collections.Generic;
4 
5 using SiliconStudio.Shaders.Ast;
6 
7 namespace SiliconStudio.Paradox.Shaders.Parser.Ast
8 {
10  {
11  #region Public Properties
12 
13  /// <summary>
14  /// Initializes a new instance of the <see cref="NamespaceBlock"/> class.
15  /// </summary>
16  public NamespaceBlock() : this(null)
17  {
18  }
19 
20  /// <summary>
21  /// Initializes a new instance of the <see cref="TypeBase" /> class.
22  /// </summary>
23  /// <param name="name">The name.</param>
24  public NamespaceBlock(string name)
25  : base(name)
26  {
27  Body = new List<Node>();
28  }
29 
30  /// <summary>
31  /// Gets or sets the body.
32  /// </summary>
33  /// <value>The body.</value>
34  public List<Node> Body { get; set; }
35 
36  #endregion
37 
38  #region Public Methods
39 
40  /// <inheritdoc />
41  public override IEnumerable<Node> Childrens()
42  {
43  ChildrenList.Clear();
44  ChildrenList.Add(Name);
45  ChildrenList.AddRange(Body);
46  return ChildrenList;
47  }
48 
49  /// <inheritdoc />
50  public override string ToString()
51  {
52  return string.Format("namespace {0} {{...}}", Name);
53  }
54 
55  #endregion
56  }
57 }
A tag interface to identify a container for scope declarations.
Base type for all types.
Definition: TypeBase.cs:11
override IEnumerable< Node > Childrens()
Gets the child nodes. An enumeration of child nodes
NamespaceBlock(string name)
Initializes a new instance of the TypeBase class.
NamespaceBlock()
Initializes a new instance of the NamespaceBlock class.