Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
Pass.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;
4 using System.Collections;
5 using System.Collections.Generic;
6 
7 namespace SiliconStudio.Shaders.Ast.Hlsl
8 {
9  /// <summary>
10  /// A technique pass.
11  /// </summary>
12  public class Pass : Node, IAttributes
13  {
14  #region Constructors and Destructors
15 
16  /// <summary>
17  /// Initializes a new instance of the <see cref = "Pass" /> class.
18  /// </summary>
19  public Pass()
20  {
21  Attributes = new List<AttributeBase>();
22  Items = new List<Expression>();
23  }
24 
25  #endregion
26 
27  #region Public Properties
28 
29  /// <summary>
30  /// Gets or sets the attributes.
31  /// </summary>
32  /// <value>
33  /// The attributes.
34  /// </value>
35  public List<AttributeBase> Attributes { get; set; }
36 
37  /// <summary>
38  /// Gets or sets the items.
39  /// </summary>
40  /// <value>
41  /// The items.
42  /// </value>
43  /// <remarks>
44  /// An item is either a <see cref = "MethodInvocationExpression" /> or a <see cref = "AssignmentExpression" />.
45  /// </remarks>
46  public List<Expression> Items { get; set; }
47 
48  /// <summary>
49  /// Gets or sets the name.
50  /// </summary>
51  /// <value>
52  /// The name.
53  /// </value>
54  public Identifier Name { get; set; }
55 
56  #endregion
57 
58  #region Public Methods
59 
60  /// <inheritdoc />
61  public override IEnumerable<Node> Childrens()
62  {
63  ChildrenList.Clear();
64  ChildrenList.Add(Name);
65  ChildrenList.AddRange(Attributes);
66  ChildrenList.AddRange(Items);
67  return ChildrenList;
68  }
69 
70  /// <inheritdoc />
71  public override string ToString()
72  {
73  return string.Format("pass {0}{{...}}", Name != null ? Name + " " : string.Empty);
74  }
75 
76  #endregion
77  }
78 }
override string ToString()
Definition: Pass.cs:71
override IEnumerable< Node > Childrens()
Gets the child nodes. An enumeration of child nodes
Definition: Pass.cs:61
Abstract node.
Definition: Node.cs:15
Pass()
Initializes a new instance of the Pass class.
Definition: Pass.cs:19
A technique pass.
Definition: Pass.cs:12