Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
MaterialNodeEntry.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 
5 namespace SiliconStudio.Paradox.Assets.Materials
6 {
7  /// <summary>
8  /// An entry to a nested <see cref="IMaterialNode"/>
9  /// </summary>
10  public struct MaterialNodeEntry
11  {
12  private readonly IMaterialNode node;
13  private readonly Action<IMaterialNode> setter;
14 
15  /// <summary>
16  /// Initializes a new instance of the <see cref="MaterialNodeEntry"/> struct.
17  /// </summary>
18  /// <param name="node">The node.</param>
19  /// <param name="setter">The setter.</param>
20  /// <exception cref="System.ArgumentNullException">setter</exception>
21  public MaterialNodeEntry(IMaterialNode node, Action<IMaterialNode> setter )
22  {
23  if (setter == null) throw new ArgumentNullException("setter");
24  this.node = node;
25  this.setter = setter;
26  }
27 
28  /// <summary>
29  /// Gets or sets the node.
30  /// </summary>
31  /// <value>The node.</value>
32  public IMaterialNode Node
33  {
34  get
35  {
36  return node;
37  }
38  set
39  {
40  setter(value);
41  }
42  }
43  }
44 }
An entry to a nested IMaterialNode
MaterialNodeEntry(IMaterialNode node, Action< IMaterialNode > setter)
Initializes a new instance of the MaterialNodeEntry struct.
Base interface for all nodes in the material tree