Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
GenericParameterConstraint.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 using SiliconStudio.Shaders.Ast;
6 
7 namespace SiliconStudio.Shaders.Ast
8 {
9  /// <summary>
10  /// A Generic parameter for a method that provides a constraint resolver.
11  /// </summary>
13  {
14  /// <summary>
15  /// Initializes a new instance of the <see cref="GenericParameterConstraint"/> class.
16  /// </summary>
17  /// <param name="name">The name.</param>
18  public GenericParameterConstraint(string name)
19  {
20  Name = name;
21  }
22 
23  /// <summary>
24  /// Initializes a new instance of the <see cref="GenericParameterConstraint"/> class.
25  /// </summary>
26  /// <param name="name">The name.</param>
27  /// <param name="constraint">The constraint.</param>
28  public GenericParameterConstraint(string name, Func<TypeBase, bool> constraint)
29  {
30  Name = name;
31  Constraint = constraint;
32  }
33 
34  /// <summary>
35  /// Gets or sets the name.
36  /// </summary>
37  /// <value>
38  /// The name.
39  /// </value>
40  public string Name { get; set; }
41 
42 
43  /// <summary>
44  /// Gets or sets the constraint match function.
45  /// </summary>
46  /// <value>
47  /// The constraint match function.
48  /// </value>
49  public Func<TypeBase, bool> Constraint { get; set; }
50  }
51 }
GenericParameterConstraint(string name, Func< TypeBase, bool > constraint)
Initializes a new instance of the GenericParameterConstraint class.
A Generic parameter for a method that provides a constraint resolver.
GenericParameterConstraint(string name)
Initializes a new instance of the GenericParameterConstraint class.