Пример #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);
     }
 }
Пример #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)));
 }
Пример #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);
        }
Пример #4
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Ambient.GetHashCode();
         hashCode = (hashCode * 397) ^ Color.Truncate().GetHashCode();
         hashCode = (hashCode * 397) ^ Diffuse.Truncate().GetHashCode();
         hashCode = (hashCode * 397) ^ Shininess.Truncate().GetHashCode();
         hashCode = (hashCode * 397) ^ Specular.Truncate().GetHashCode();
         return(hashCode);
     }
 }
Пример #5
0
 public override int GetHashCode()
 {
     return
         (Color.GetHashCode() ^
          Ambient.GetHashCode() ^
          Diffuse.GetHashCode() ^
          Specular.GetHashCode() ^
          Shininess.GetHashCode() ^
          Pattern.GetHashCode() ^
          Reflective.GetHashCode() ^
          Transparency.GetHashCode() ^
          RefractiveIndex.GetHashCode());
 }
Пример #6
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);
     }
 }
Пример #7
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);
            }
        }
Пример #8
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);
        }
Пример #9
0
 public override int GetHashCode()
 {
     return(Ambient.GetHashCode());
 }