Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SwitchCaseGroup.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
8 {
9 
10  /// <summary>
11  /// A group of cases and default attached to their statements.
12  /// </summary>
13  public class SwitchCaseGroup : Node
14  {
15  /// <summary>
16  /// Initializes a new instance of the <see cref="SwitchCaseGroup"/> class.
17  /// </summary>
18  public SwitchCaseGroup()
19  {
20  Cases = new List<CaseStatement>();
21  Statements = new StatementList();
22  }
23 
24  #region Public Properties
25 
26  /// <summary>
27  /// Gets or sets the cases.
28  /// </summary>
29  /// <value>
30  /// The cases.
31  /// </value>
32  public List<CaseStatement> Cases { get; set; }
33 
34  /// <summary>
35  /// Gets or sets the statements.
36  /// </summary>
37  /// <value>
38  /// The statements.
39  /// </value>
40  public StatementList Statements { get; set; }
41 
42  #endregion
43 
44  #region Public Methods
45 
46  /// <inheritdoc />
47  public override IEnumerable<Node> Childrens()
48  {
49  ChildrenList.Clear();
50  ChildrenList.AddRange(Cases);
51  ChildrenList.Add(Statements);
52  return ChildrenList;
53  }
54 
55  /// <inheritdoc />
56  public override string ToString()
57  {
58  return string.Format("{0} ...", string.Join("\n", Cases));
59  }
60 
61  #endregion
62  }
63 }
override IEnumerable< Node > Childrens()
Gets the child nodes. An enumeration of child nodes
Abstract node.
Definition: Node.cs:15
A group of cases and default attached to their statements.
SwitchCaseGroup()
Initializes a new instance of the SwitchCaseGroup class.