Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
LayoutKeyValue.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 namespace SiliconStudio.Shaders.Ast.Glsl
4 {
5  /// <summary>
6  /// LayoutKey value node.
7  /// </summary>
8  public class LayoutKeyValue : Node
9  {
10  /// <summary>
11  /// Initializes a new instance of the <see cref="LayoutKeyValue"/> class.
12  /// </summary>
13  public LayoutKeyValue()
14  {
15  }
16 
17  /// <summary>
18  /// Initializes a new instance of the <see cref="LayoutKeyValue"/> class.
19  /// </summary>
20  /// <param name="name">The name.</param>
22  {
23  Name = name;
24  }
25 
26  /// <summary>
27  /// Initializes a new instance of the <see cref="LayoutKeyValue"/> class.
28  /// </summary>
29  /// <param name="name">The name.</param>
30  /// <param name="value">The value.</param>
32  {
33  Name = name;
34  Value = value;
35  }
36 
37  /// <summary>
38  /// Initializes a new instance of the <see cref="LayoutKeyValue"/> class.
39  /// </summary>
40  /// <param name="name">The name.</param>
41  /// <param name="value">The value.</param>
42  public LayoutKeyValue(Identifier name, object value)
43  {
44  Name = name;
45  Value = new LiteralExpression(value);
46  }
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  /// <summary>
57  /// Gets or sets the value.
58  /// </summary>
59  /// <value>
60  /// The value.
61  /// </value>
62  public LiteralExpression Value { get; set; }
63 
64  /// <inheritdoc/>
65  public override System.Collections.Generic.IEnumerable<Node> Childrens()
66  {
67  ChildrenList.Clear();
68  ChildrenList.Add(Name);
69  ChildrenList.Add(Value);
70  return ChildrenList;
71  }
72 
73  /// <inheritdoc/>
74  public override string ToString()
75  {
76  return string.Format("{0}{1}", Name, Value == null ? string.Empty : "=" + Value);
77  }
78  }
79 }
LayoutKeyValue(Identifier name)
Initializes a new instance of the LayoutKeyValue class.
override System.Collections.Generic.IEnumerable< Node > Childrens()
Gets the child nodes. An enumeration of child nodes
Abstract node.
Definition: Node.cs:15
LayoutKeyValue(Identifier name, LiteralExpression value)
Initializes a new instance of the LayoutKeyValue class.
LayoutKeyValue(Identifier name, object value)
Initializes a new instance of the LayoutKeyValue class.
LayoutKeyValue()
Initializes a new instance of the LayoutKeyValue class.