Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
MaterialNodeBase.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 using System.ComponentModel;
5 using System.Linq;
6 using SiliconStudio.Core;
7 
8 namespace SiliconStudio.Paradox.Assets.Materials
9 {
10  /// <summary>
11  /// Base implementation for <see cref="IMaterialNode"/>.
12  /// </summary>
13  [DataContract(Inherited = true)]
14  public abstract class MaterialNodeBase : IMaterialNode
15  {
16  /// <summary>
17  /// Initializes a new instance of the <see cref="MaterialNodeBase"/> class.
18  /// </summary>
19  protected MaterialNodeBase()
20  {
21  IsReducible = true;
22  }
23 
24  /// <summary>
25  /// The flag to allow the node to be reducible.
26  /// </summary>
27  /// <userdoc>
28  /// If checked, the material will try to merge this node with its children and parents. As a consequence, parameters made runtime-editable (through the use of custom ParameterKey) might no longer be.
29  /// </userdoc>
30  [DataMember(1000)]
31  [DefaultValue(true)]
32  public bool IsReducible { get; set; }
33 
34  /// <inheritdoc/>
35  public virtual IEnumerable<MaterialNodeEntry> GetChildren(object context = null)
36  {
37  return Enumerable.Empty<MaterialNodeEntry>();
38  }
39  }
40 }
An entry to a nested IMaterialNode
virtual IEnumerable< MaterialNodeEntry > GetChildren(object context=null)
Gets the children. The context to get the children.The list of children.
MaterialNodeBase()
Initializes a new instance of the MaterialNodeBase class.
Base interface for all nodes in the material tree