4 using System.Collections;
5 using System.Collections.Generic;
9 namespace SiliconStudio.Shaders.Ast
16 #region Constructors and Destructors
31 Parameters =
new List<Node>();
32 for (
int i = 0; i < parameterCount; i++)
40 #region Public Properties
50 var builder =
new StringBuilder();
51 builder.Append(Name).Append(
"<");
52 for (
int i = 0; i < Parameters.Count; i++)
54 var parameter = Parameters[i];
60 builder.Append(parameter is
TypeBase ? ((
TypeBase)parameter).Name : parameter);
65 return builder.ToString();
82 public List<Node> Parameters {
get; set; }
86 #region Public Methods
99 if (ReferenceEquals(null, other))
104 if (ReferenceEquals(
this, other))
110 return base.Equals(other) && Parameters.SequenceEqual(other.
Parameters);
116 if (ReferenceEquals(null, obj))
121 if (ReferenceEquals(
this, obj))
136 ChildrenList.Clear();
137 foreach (var parameter
in Parameters)
139 if (parameter is
Node)
141 ChildrenList.Add((Node)parameter);
151 var hashCode = base.GetHashCode() * 397;
152 foreach (var parameter
in Parameters)
154 hashCode = (hashCode * 397) ^ (parameter != null ? parameter.GetHashCode() : 0);
174 return Equals(left, right);
187 return !Equals(left, right);
201 #region Constants and Fields
207 #region Constructors and Destructors
238 : base(name, parameterCount)
240 ParameterTypes = ParameterTypeT1;
257 #region Constants and Fields
259 private static readonly
List<Type> ParameterTypeT1T2 =
new List<Type> { typeof(T1), typeof(T2) };
263 #region Constructors and Destructors
294 : base(name, parameterCount)
296 ParameterTypes = ParameterTypeT1T2;
316 #region Constants and Fields
318 private static readonly
List<Type> ParameterTypeT1T2T3 =
new List<Type> { typeof(T1), typeof(T2), typeof(T3) };
322 #region Constructors and Destructors
333 ParameterTypes = ParameterTypeT1T2T3;
342 ParameterTypes = ParameterTypeT1T2T3;
355 : base(name, parameterCount)
357 ParameterTypes = ParameterTypeT1T2T3;
GenericType()
Initializes a new instance of the GenericType<T1, T2> class.
bool Equals(GenericType other)
Equalses the specified other.
GenericType(string name, int parameterCount)
Initializes a new instance of the GenericType<T1, T2> class.
GenericType(string name)
Initializes a new instance of the GenericType<T1> class.
GenericType()
Initializes a new instance of the GenericType<T1> class.
GenericType(string name, int parameterCount)
Initializes a new instance of the GenericType class.
override string ToString()
Gets the full name.
override IEnumerable< Node > Childrens()
Gets the child nodes.
override int GetHashCode()
List< Node > Parameters
Gets or sets the parameters.
override bool Equals(object obj)
Base class for all generic types.
GenericType()
Initializes a new instance of the GenericType<T1, T2, T3> class.
GenericType(string name)
Initializes a new instance of the GenericType<T1, T2, T3> class.
GenericType(string name)
Initializes a new instance of the GenericType<T1, T2> class.
GenericType(string name, int parameterCount)
Initializes a new instance of the GenericType<T1, T2, T3> class.
GenericType(string name, int parameterCount)
Initializes a new instance of the GenericType<T1> class.