Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
LayoutQualifier.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 using System.Text;
5 
6 namespace SiliconStudio.Shaders.Ast.Glsl
7 {
8  /// <summary>
9  /// Describe a register location
10  /// </summary>
11  public class LayoutQualifier : Qualifier
12  {
13  #region Constructors and Destructors
14 
15  /// <summary>
16  /// Initializes a new instance of the <see cref="LayoutQualifier"/> class.
17  /// </summary>
18  public LayoutQualifier() : base("layout")
19  {
20  Layouts = new List<LayoutKeyValue>();
21  IsPost = false;
22  }
23 
24  /// <summary>
25  /// Initializes a new instance of the <see cref="LayoutQualifier"/> class.
26  /// </summary>
27  /// <param name="layouts">The layouts.</param>
28  public LayoutQualifier(params LayoutKeyValue[] layouts) : this()
29  {
30  Layouts.AddRange(layouts);
31  }
32 
33  #endregion
34 
35  #region Public Properties
36 
37  /// <summary>
38  /// Gets or sets the profile.
39  /// </summary>
40  /// <value>
41  /// The profile.
42  /// </value>
43  public List<LayoutKeyValue> Layouts { get; set; }
44 
45  #endregion
46 
47  #region Public Methods
48 
49 
50 
51  /// <inheritdoc />
52  public override IEnumerable<Node> Childrens()
53  {
54  return Layouts;
55  }
56 
57  /// <inheritdoc />
58  public override string DisplayName
59  {
60  get
61  {
62  var builder = new StringBuilder();
63  builder.Append("layout(");
64  for (int i = 0; i < Layouts.Count; i++)
65  {
66  if (i > 0) builder.Append(", ");
67  builder.Append(Layouts[i]);
68  }
69  return builder.ToString();
70  }
71  }
72 
73  #endregion
74  }
75 }
LayoutQualifier(params LayoutKeyValue[] layouts)
Initializes a new instance of the LayoutQualifier class.
LayoutQualifier()
Initializes a new instance of the LayoutQualifier class.
override IEnumerable< Node > Childrens()
Gets the child nodes. An enumeration of child nodes