Ejemplo n.º 1
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Ambient != null)
         {
             hashCode = hashCode * 59 + Ambient.GetHashCode();
         }
         if (Diffuse != null)
         {
             hashCode = hashCode * 59 + Diffuse.GetHashCode();
         }
         if (Specular != null)
         {
             hashCode = hashCode * 59 + Specular.GetHashCode();
         }
         if (Roughness != null)
         {
             hashCode = hashCode * 59 + Roughness.GetHashCode();
         }
         if (Fresnel != null)
         {
             hashCode = hashCode * 59 + Fresnel.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 2
0
 public override int GetHashCode()
 {
     return((int)(
                (Name.GetHashCode() * 3) +
                (Ambient.GetHashCode() * 5) +
                (Diffuse.GetHashCode() * 7) +
                (Specular.GetHashCode() * 11) +
                (Emissive.GetHashCode() * 13) +
                (Reflectivity * 17) +
                (Opacity * 19)));
 }
Ejemplo n.º 3
0
        public override int GetHashCode()
        {
            int hashCode = -2043694805;

            hashCode = hashCode * -1521134295 + Ambient.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <Color> .Default.GetHashCode(Color);

            hashCode = hashCode * -1521134295 + Diffuse.GetHashCode();
            hashCode = hashCode * -1521134295 + Shininess.GetHashCode();
            hashCode = hashCode * -1521134295 + Specular.GetHashCode();
            return(hashCode);
        }
Ejemplo n.º 4
0
 public override int GetHashCode()
 {
     return
         (Color.GetHashCode() ^
          Ambient.GetHashCode() ^
          Diffuse.GetHashCode() ^
          Specular.GetHashCode() ^
          Shininess.GetHashCode() ^
          Pattern.GetHashCode() ^
          Reflective.GetHashCode() ^
          Transparency.GetHashCode() ^
          RefractiveIndex.GetHashCode());
 }
Ejemplo n.º 5
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Pattern != null ? Pattern.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Ambient.GetHashCode();
         hashCode = (hashCode * 397) ^ Diffuse.GetHashCode();
         hashCode = (hashCode * 397) ^ Specular.GetHashCode();
         hashCode = (hashCode * 397) ^ Reflective.GetHashCode();
         hashCode = (hashCode * 397) ^ Shininess;
         return(hashCode);
     }
 }
Ejemplo n.º 6
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Color != null?Color.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ Ambient.GetHashCode();
                hashCode = (hashCode * 397) ^ Diffuse.GetHashCode();
                hashCode = (hashCode * 397) ^ Specular.GetHashCode();
                hashCode = (hashCode * 397) ^ Shininess.GetHashCode();
                return(hashCode);
            }
        }
Ejemplo n.º 7
0
        public override int GetHashCode()
        {
            var hashCode = 412502415;

            hashCode = hashCode * -1521134295 + EqualityComparer <Pattern> .Default.GetHashCode(pattern);

            hashCode = hashCode * -1521134295 + EqualityComparer <Color> .Default.GetHashCode(color);

            hashCode = hashCode * -1521134295 + ambient.GetHashCode();
            hashCode = hashCode * -1521134295 + diffuse.GetHashCode();
            hashCode = hashCode * -1521134295 + specular.GetHashCode();
            hashCode = hashCode * -1521134295 + shinniness.GetHashCode();
            hashCode = hashCode * -1521134295 + reflective.GetHashCode();
            hashCode = hashCode * -1521134295 + refractiveIndex.GetHashCode();
            hashCode = hashCode * -1521134295 + transparency.GetHashCode();
            hashCode = hashCode * -1521134295 + Ambient.GetHashCode();
            hashCode = hashCode * -1521134295 + Diffuse.GetHashCode();
            hashCode = hashCode * -1521134295 + Specular.GetHashCode();
            hashCode = hashCode * -1521134295 + Shinniness.GetHashCode();
            hashCode = hashCode * -1521134295 + Reflective.GetHashCode();
            hashCode = hashCode * -1521134295 + RefracIndex.GetHashCode();
            hashCode = hashCode * -1521134295 + Transparency.GetHashCode();
            return(hashCode);
        }