Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
CastExpression.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 cast expression.
11  /// </summary>
12  public class CastExpression : Expression
13  {
14  #region Public Properties
15 
16  /// <summary>
17  /// Gets or sets from.
18  /// </summary>
19  /// <value>
20  /// From.
21  /// </value>
22  public Expression From { get; set; }
23 
24  /// <summary>
25  /// Gets or sets the target.
26  /// </summary>
27  /// <value>
28  /// The target.
29  /// </value>
30  public TypeBase Target { get; set; }
31 
32  #endregion
33 
34  #region Public Methods
35 
36  /// <inheritdoc />
37  public override IEnumerable<Node> Childrens()
38  {
39  ChildrenList.Clear();
40  ChildrenList.Add(Target);
41  ChildrenList.Add(From);
42  return ChildrenList;
43  }
44 
45  /// <inheritdoc />
46  public override string ToString()
47  {
48  return string.Format("({0}){1}", Target, From);
49  }
50 
51  #endregion
52  }
53 }
Base type for all types.
Definition: TypeBase.cs:11
override IEnumerable< Node > Childrens()
Gets the child nodes. An enumeration of child nodes