Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SamplerTextureKey.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 SiliconStudio.Shaders.Ast;
5 
6 namespace SiliconStudio.Shaders.Convertor
7 {
8  struct SamplerTextureKey : IEquatable<SamplerTextureKey>
9  {
10  public Variable Sampler;
11  public Variable Texture;
12 
13  public SamplerTextureKey(Variable sampler, Variable texture)
14  {
15  Sampler = sampler;
16  Texture = texture;
17  }
18 
19  public bool Equals(SamplerTextureKey other)
20  {
21  return Sampler.Equals(other.Sampler) && Texture.Equals(other.Texture);
22  }
23 
24  public override bool Equals(object obj)
25  {
26  if (ReferenceEquals(null, obj)) return false;
27  return obj is SamplerTextureKey && Equals((SamplerTextureKey)obj);
28  }
29 
30  public override int GetHashCode()
31  {
32  unchecked
33  {
34  return (Sampler.GetHashCode()*397) ^ Texture.GetHashCode();
35  }
36  }
37  }
38 }
SamplerTextureKey(Variable sampler, Variable texture)
A variable declaration.
Definition: Variable.cs:11