Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
MixinStatement.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 {
9  /// <summary>
10  /// A mixin statement.
11  /// </summary>
13  {
14  #region Constructors and Destructors
15 
16  /// <summary>
17  /// Initializes a new instance of the <see cref = "MixinStatement" /> class.
18  /// </summary>
19  public MixinStatement()
20  {
21  }
22 
23  /// <summary>
24  /// Initializes a new instance of the <see cref="MixinStatement" /> class.
25  /// </summary>
26  /// <param name="type">The type.</param>
27  /// <param name="mixin">The mixin.</param>
29  {
30  Type = type;
31  Value = mixin;
32  }
33 
34  #endregion
35 
36  #region Public Properties
37 
38  /// <summary>
39  /// Gets or sets the type.
40  /// </summary>
41  /// <value>The type.</value>
42  public MixinStatementType Type { get; set; }
43 
44  /// <summary>
45  /// Gets or sets the target of this mixin.
46  /// </summary>
47  /// <value>The target.</value>
48  public Expression Value { get; set; }
49 
50  #endregion
51 
52  #region Public Methods
53 
54  /// <inheritdoc />
55  public override IEnumerable<Node> Childrens()
56  {
57  ChildrenList.Clear();
58  ChildrenList.Add(Value);
59  return ChildrenList;
60  }
61 
62  /// <inheritdoc />
63  public override string ToString()
64  {
65  return string.Format("mixin {0}{1};", Type > 0 ? Type.ToString().ToLowerInvariant() + " " : string.Empty, Value);
66  }
67 
68  #endregion
69  }
70 }
MixinStatement()
Initializes a new instance of the MixinStatement class.
MixinStatement(MixinStatementType type, Expression mixin)
Initializes a new instance of the MixinStatement class.
A tag interface to identify a container for scope declarations.
Base root class for all statements.
Definition: Statement.cs:11
override IEnumerable< Node > Childrens()
Gets the child nodes. An enumeration of child nodes