Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
StateExpression.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 state expresion in the form: sampler {...}.
11  /// </summary>
12  public class StateExpression : Expression
13  {
14  #region Constructors and Destructors
15 
16  /// <summary>
17  /// Initializes a new instance of the <see cref = "StateExpression" /> class.
18  /// </summary>
19  public StateExpression()
20  {
21  }
22 
23  /// <summary>
24  /// Initializes a new instance of the <see cref="StateExpression"/> class.
25  /// </summary>
26  /// <param name="stateType">
27  /// Type of the state.
28  /// </param>
29  /// <param name="initializer">
30  /// The initializer.
31  /// </param>
32  public StateExpression(TypeName stateType, StateInitializer initializer)
33  {
34  this.StateType = stateType;
35  this.Initializer = initializer;
36  }
37 
38  #endregion
39 
40  #region Public Properties
41 
42  /// <summary>
43  /// Gets or sets the initializer.
44  /// </summary>
45  /// <value>
46  /// The initializer.
47  /// </value>
48  public StateInitializer Initializer { get; set; }
49 
50  /// <summary>
51  /// Gets or sets the type of the sampler.
52  /// </summary>
53  /// <value>
54  /// The type of the sampler.
55  /// </value>
56  public TypeBase StateType { get; set; }
57 
58  #endregion
59 
60  #region Public Methods
61 
62  /// <inheritdoc />
63  public override IEnumerable<Node> Childrens()
64  {
65  ChildrenList.Clear();
66  ChildrenList.Add(StateType);
67  ChildrenList.Add(Initializer);
68  return ChildrenList;
69  }
70 
71  /// <inheritdoc />
72  public override string ToString()
73  {
74  return string.Format("{0} {1}", StateType, Initializer);
75  }
76 
77  #endregion
78  }
79 }
A typeless reference.
Definition: TypeName.cs:10
A state expresion in the form: sampler {...}.
StateExpression(TypeName stateType, StateInitializer initializer)
Initializes a new instance of the StateExpression class.
Base type for all types.
Definition: TypeBase.cs:11
StateExpression()
Initializes a new instance of the StateExpression class.
override IEnumerable< Node > Childrens()
Gets the child nodes. An enumeration of child nodes