Пример #1
0
        public List<string> GetHashCode(BitmapImage bitmap)
        {//takes a bitmap and translates it into the hashcode list
            List<string> hashCode= new List<string>();

            int stride = bitmap.PixelWidth * (bitmap.Format.BitsPerPixel / 8);
            for (int i = 0; i < bitmap.PixelHeight; i++)//divides an image into rows 
            {
                string row="";
                for (int x = 0; x < bitmap.PixelWidth; x++)//iterates through each pixel in the row
                {
                    byte[] pixel = new byte[bitmap.PixelHeight];//holds color values of a single pixel
                    bitmap.CopyPixels(new Int32Rect(x, i, 1, 1), pixel, stride, 0);//assigns color values of a single pixel to the pixel array
                    Color singlePixel = new Color();//creates new color objects and assigns the color values found in pixel array to it
                    singlePixel.B = pixel[0];
                    singlePixel.G = pixel[1];
                    singlePixel.R = pixel[2];
                    singlePixel.A = pixel[3];
                    row += singlePixel.GetHashCode().ToString();//converst the color value into the hashcode and converts it to the string
                }
                hashCode.Add(row);
                if (i % 20 == 0)//Updates programm only after each tenth iteration, this makes program run a bit faster
                UpdatePRogress();
            }
            return hashCode;
        }
Пример #2
0
 /// <summary>
 /// Initializes a new TextEntity class.
 /// </summary>
 /// <param name="text">The Text.</param>
 /// <param name="font">The Font.</param>
 /// <param name="color">The Color.</param>
 /// <param name="wrapWidth">The Wordwrap Width.</param>
 public TextEntity(string text, OpenGLFont font, Color color, int wrapWidth = 0)
 {
     if (wrapWidth > 0) text = text.WordWrap(wrapWidth);
     var gdiFont = OpenGLHelper.ConvertFont(font);
     Id = text.GetHashCode() + gdiFont.GetHashCode() + color.GetHashCode();
     _text = text;
     _font = gdiFont;
     _color = color;
 }
Пример #3
0
        public void Equals()
        {
            var color1 = new Color(10, 20, 30, 40);
            var color2 = new Color(20, 30, 40, 50);

            Assert.AreNotEqual(color1, color2);
            Assert.AreEqual(color1, new Color(10, 20, 30, 40));

            Assert.IsTrue(color1 == new Color(10, 20, 30, 40));
            Assert.IsTrue(color1 != color2);
            Assert.IsTrue(color1.Equals((object)new Color(10, 20, 30, 40)));
            Assert.AreEqual(color1.PackedArgb, color1.GetHashCode());
        }
Пример #4
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Color?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ ContentId.GetHashCode();
         hashCode = (hashCode * 397) ^ (Description?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (IconUrl?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ Id;
         hashCode = (hashCode * 397) ^ (Name?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
Пример #5
0
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = UseInput ? -1 : Color?.GetHashCode() ?? Name?.GetHashCode() ?? Data?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ Desaturate.GetHashCode();
         hashCode = (hashCode * 397) ^ NormalizeMax.GetHashCode();
         hashCode = (hashCode * 397) ^ (RedChannelSource?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (GreenChannelSource?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (BlueChannelSource?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (AlphaChannelSource?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ RedFrom.GetHashCode();
         hashCode = (hashCode * 397) ^ GreenFrom.GetHashCode();
         hashCode = (hashCode * 397) ^ BlueFrom.GetHashCode();
         hashCode = (hashCode * 397) ^ AlphaFrom.GetHashCode();
         return(hashCode);
     }
 }
 public static BitmapDescriptor DefaultMarker(Color color)
 {
     return(BitmapDescriptor.DefaultMarker(color, color.GetHashCode().ToString()));
 }
Пример #7
0
 public override int GetHashCode()
 {
     return(_color.GetHashCode());
 }
Пример #8
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Color != null)
         {
             hashCode = hashCode * 59 + Color.GetHashCode();
         }
         if (Smoothing != null)
         {
             hashCode = hashCode * 59 + Smoothing.GetHashCode();
         }
         if (Title != null)
         {
             hashCode = hashCode * 59 + Title.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (AutoTypeNumbers != null)
         {
             hashCode = hashCode * 59 + AutoTypeNumbers.GetHashCode();
         }
         if (AutoRange != null)
         {
             hashCode = hashCode * 59 + AutoRange.GetHashCode();
         }
         if (RangeMode != null)
         {
             hashCode = hashCode * 59 + RangeMode.GetHashCode();
         }
         if (Range != null)
         {
             hashCode = hashCode * 59 + Range.GetHashCode();
         }
         if (FixedRange != null)
         {
             hashCode = hashCode * 59 + FixedRange.GetHashCode();
         }
         if (CheaterType != null)
         {
             hashCode = hashCode * 59 + CheaterType.GetHashCode();
         }
         if (TickMode != null)
         {
             hashCode = hashCode * 59 + TickMode.GetHashCode();
         }
         if (NTicks != null)
         {
             hashCode = hashCode * 59 + NTicks.GetHashCode();
         }
         if (TickVals != null)
         {
             hashCode = hashCode * 59 + TickVals.GetHashCode();
         }
         if (TickText != null)
         {
             hashCode = hashCode * 59 + TickText.GetHashCode();
         }
         if (ShowTickLabels != null)
         {
             hashCode = hashCode * 59 + ShowTickLabels.GetHashCode();
         }
         if (TickFont != null)
         {
             hashCode = hashCode * 59 + TickFont.GetHashCode();
         }
         if (TickAngle != null)
         {
             hashCode = hashCode * 59 + TickAngle.GetHashCode();
         }
         if (TickPrefix != null)
         {
             hashCode = hashCode * 59 + TickPrefix.GetHashCode();
         }
         if (ShowTickPrefix != null)
         {
             hashCode = hashCode * 59 + ShowTickPrefix.GetHashCode();
         }
         if (TickSuffix != null)
         {
             hashCode = hashCode * 59 + TickSuffix.GetHashCode();
         }
         if (ShowTickSuffix != null)
         {
             hashCode = hashCode * 59 + ShowTickSuffix.GetHashCode();
         }
         if (ShowExponent != null)
         {
             hashCode = hashCode * 59 + ShowExponent.GetHashCode();
         }
         if (ExponentFormat != null)
         {
             hashCode = hashCode * 59 + ExponentFormat.GetHashCode();
         }
         if (MinExponent != null)
         {
             hashCode = hashCode * 59 + MinExponent.GetHashCode();
         }
         if (SeparateThousands != null)
         {
             hashCode = hashCode * 59 + SeparateThousands.GetHashCode();
         }
         if (TickFormat != null)
         {
             hashCode = hashCode * 59 + TickFormat.GetHashCode();
         }
         if (TickFormatStops != null)
         {
             hashCode = hashCode * 59 + TickFormatStops.GetHashCode();
         }
         if (CategoryOrder != null)
         {
             hashCode = hashCode * 59 + CategoryOrder.GetHashCode();
         }
         if (CategoryArray != null)
         {
             hashCode = hashCode * 59 + CategoryArray.GetHashCode();
         }
         if (LabelPadding != null)
         {
             hashCode = hashCode * 59 + LabelPadding.GetHashCode();
         }
         if (LabelPrefix != null)
         {
             hashCode = hashCode * 59 + LabelPrefix.GetHashCode();
         }
         if (LabelSuffix != null)
         {
             hashCode = hashCode * 59 + LabelSuffix.GetHashCode();
         }
         if (ShowLine != null)
         {
             hashCode = hashCode * 59 + ShowLine.GetHashCode();
         }
         if (LineColor != null)
         {
             hashCode = hashCode * 59 + LineColor.GetHashCode();
         }
         if (LineWidth != null)
         {
             hashCode = hashCode * 59 + LineWidth.GetHashCode();
         }
         if (GridColor != null)
         {
             hashCode = hashCode * 59 + GridColor.GetHashCode();
         }
         if (GridWidth != null)
         {
             hashCode = hashCode * 59 + GridWidth.GetHashCode();
         }
         if (ShowGrid != null)
         {
             hashCode = hashCode * 59 + ShowGrid.GetHashCode();
         }
         if (MinorGridCount != null)
         {
             hashCode = hashCode * 59 + MinorGridCount.GetHashCode();
         }
         if (MinorGridWidth != null)
         {
             hashCode = hashCode * 59 + MinorGridWidth.GetHashCode();
         }
         if (MinorGridColor != null)
         {
             hashCode = hashCode * 59 + MinorGridColor.GetHashCode();
         }
         if (StartLine != null)
         {
             hashCode = hashCode * 59 + StartLine.GetHashCode();
         }
         if (StartLineColor != null)
         {
             hashCode = hashCode * 59 + StartLineColor.GetHashCode();
         }
         if (StartLineWidth != null)
         {
             hashCode = hashCode * 59 + StartLineWidth.GetHashCode();
         }
         if (EndLine != null)
         {
             hashCode = hashCode * 59 + EndLine.GetHashCode();
         }
         if (EndlineWidth != null)
         {
             hashCode = hashCode * 59 + EndlineWidth.GetHashCode();
         }
         if (EndlineColor != null)
         {
             hashCode = hashCode * 59 + EndlineColor.GetHashCode();
         }
         if (Tick0 != null)
         {
             hashCode = hashCode * 59 + Tick0.GetHashCode();
         }
         if (DTick != null)
         {
             hashCode = hashCode * 59 + DTick.GetHashCode();
         }
         if (ArrayTick0 != null)
         {
             hashCode = hashCode * 59 + ArrayTick0.GetHashCode();
         }
         if (ArrayDTick != null)
         {
             hashCode = hashCode * 59 + ArrayDTick.GetHashCode();
         }
         if (TickValsSrc != null)
         {
             hashCode = hashCode * 59 + TickValsSrc.GetHashCode();
         }
         if (TickTextSrc != null)
         {
             hashCode = hashCode * 59 + TickTextSrc.GetHashCode();
         }
         if (CategoryArraySrc != null)
         {
             hashCode = hashCode * 59 + CategoryArraySrc.GetHashCode();
         }
         return(hashCode);
     }
 }
 /// <inheritdoc cref="Rectangle.GetHashCode"/>
 public override int GetHashCode()
 {
     return(base.GetHashCode() ^ Color.GetHashCode());
 }
Пример #10
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Width != null)
         {
             hashCode = hashCode * 59 + Width.GetHashCode();
         }
         if (WidthArray != null)
         {
             hashCode = hashCode * 59 + WidthArray.GetHashCode();
         }
         if (Color != null)
         {
             hashCode = hashCode * 59 + Color.GetHashCode();
         }
         if (ColorArray != null)
         {
             hashCode = hashCode * 59 + ColorArray.GetHashCode();
         }
         if (CAuto != null)
         {
             hashCode = hashCode * 59 + CAuto.GetHashCode();
         }
         if (CMin != null)
         {
             hashCode = hashCode * 59 + CMin.GetHashCode();
         }
         if (CMax != null)
         {
             hashCode = hashCode * 59 + CMax.GetHashCode();
         }
         if (CMid != null)
         {
             hashCode = hashCode * 59 + CMid.GetHashCode();
         }
         if (ColorScale != null)
         {
             hashCode = hashCode * 59 + ColorScale.GetHashCode();
         }
         if (AutoColorScale != null)
         {
             hashCode = hashCode * 59 + AutoColorScale.GetHashCode();
         }
         if (ReverseScale != null)
         {
             hashCode = hashCode * 59 + ReverseScale.GetHashCode();
         }
         if (ColorAxis != null)
         {
             hashCode = hashCode * 59 + ColorAxis.GetHashCode();
         }
         if (WidthSrc != null)
         {
             hashCode = hashCode * 59 + WidthSrc.GetHashCode();
         }
         if (ColorSrc != null)
         {
             hashCode = hashCode * 59 + ColorSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #11
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Visible != null)
         {
             hashCode = hashCode * 59 + Visible.GetHashCode();
         }
         if (Opacity != null)
         {
             hashCode = hashCode * 59 + Opacity.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (UId != null)
         {
             hashCode = hashCode * 59 + UId.GetHashCode();
         }
         if (Ids != null)
         {
             hashCode = hashCode * 59 + Ids.GetHashCode();
         }
         if (CustomData != null)
         {
             hashCode = hashCode * 59 + CustomData.GetHashCode();
         }
         if (Meta != null)
         {
             hashCode = hashCode * 59 + Meta.GetHashCode();
         }
         if (MetaArray != null)
         {
             hashCode = hashCode * 59 + MetaArray.GetHashCode();
         }
         if (Stream != null)
         {
             hashCode = hashCode * 59 + Stream.GetHashCode();
         }
         if (UiRevision != null)
         {
             hashCode = hashCode * 59 + UiRevision.GetHashCode();
         }
         if (_Carpet != null)
         {
             hashCode = hashCode * 59 + _Carpet.GetHashCode();
         }
         if (X != null)
         {
             hashCode = hashCode * 59 + X.GetHashCode();
         }
         if (Y != null)
         {
             hashCode = hashCode * 59 + Y.GetHashCode();
         }
         if (A != null)
         {
             hashCode = hashCode * 59 + A.GetHashCode();
         }
         if (A0 != null)
         {
             hashCode = hashCode * 59 + A0.GetHashCode();
         }
         if (DA != null)
         {
             hashCode = hashCode * 59 + DA.GetHashCode();
         }
         if (B != null)
         {
             hashCode = hashCode * 59 + B.GetHashCode();
         }
         if (B0 != null)
         {
             hashCode = hashCode * 59 + B0.GetHashCode();
         }
         if (Db != null)
         {
             hashCode = hashCode * 59 + Db.GetHashCode();
         }
         if (CheaterSlope != null)
         {
             hashCode = hashCode * 59 + CheaterSlope.GetHashCode();
         }
         if (AAxis != null)
         {
             hashCode = hashCode * 59 + AAxis.GetHashCode();
         }
         if (BAxis != null)
         {
             hashCode = hashCode * 59 + BAxis.GetHashCode();
         }
         if (Font != null)
         {
             hashCode = hashCode * 59 + Font.GetHashCode();
         }
         if (Color != null)
         {
             hashCode = hashCode * 59 + Color.GetHashCode();
         }
         if (XAxis != null)
         {
             hashCode = hashCode * 59 + XAxis.GetHashCode();
         }
         if (YAxis != null)
         {
             hashCode = hashCode * 59 + YAxis.GetHashCode();
         }
         if (IdsSrc != null)
         {
             hashCode = hashCode * 59 + IdsSrc.GetHashCode();
         }
         if (CustomDataSrc != null)
         {
             hashCode = hashCode * 59 + CustomDataSrc.GetHashCode();
         }
         if (MetaSrc != null)
         {
             hashCode = hashCode * 59 + MetaSrc.GetHashCode();
         }
         if (XSrc != null)
         {
             hashCode = hashCode * 59 + XSrc.GetHashCode();
         }
         if (YSrc != null)
         {
             hashCode = hashCode * 59 + YSrc.GetHashCode();
         }
         if (ASrc != null)
         {
             hashCode = hashCode * 59 + ASrc.GetHashCode();
         }
         if (BSrc != null)
         {
             hashCode = hashCode * 59 + BSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #12
0
        /// <summary>
        /// Returns the hash code for this instance.
        /// </summary>
        /// <returns>
        /// A 32-bit signed integer that is the hash code for this instance.
        /// </returns>
        public override int GetHashCode()
        {
            Color thisColor = this;

            return(thisColor.GetHashCode());
        }
Пример #13
0
        public string GetChecksum()
        {
            if (FixedChecksum != null)
            {
                return(FixedChecksum);
            }

            unchecked {
                long hashCode = Showroom?.GetHashCode() ?? 0;
                hashCode = (hashCode * 397) ^ SsaaMultiplier.GetHashCode();
                hashCode = (hashCode * 397) ^ PreviewWidth;
                hashCode = (hashCode * 397) ^ PreviewHeight;
                hashCode = (hashCode * 397) ^ UseFxaa.GetHashCode();
                hashCode = (hashCode * 397) ^ UseSmaa.GetHashCode();
                hashCode = (hashCode * 397) ^ UseMsaa.GetHashCode();
                hashCode = (hashCode * 397) ^ MsaaSampleCount;
                hashCode = (hashCode * 397) ^ SoftwareDownsize.GetHashCode();
                hashCode = (hashCode * 397) ^ WireframeMode.GetHashCode();
                hashCode = (hashCode * 397) ^ MeshDebugMode.GetHashCode();
                hashCode = (hashCode * 397) ^ SuspensionDebugMode.GetHashCode();
                hashCode = (hashCode * 397) ^ HeadlightsEnabled.GetHashCode();
                hashCode = (hashCode * 397) ^ BrakeLightsEnabled.GetHashCode();
                hashCode = (hashCode * 397) ^ SteerDeg.GetHashCode();
                hashCode = (hashCode * 397) ^ LeftDoorOpen.GetHashCode();
                hashCode = (hashCode * 397) ^ RightDoorOpen.GetHashCode();
                hashCode = (hashCode * 397) ^ ShowDriver.GetHashCode();
                hashCode = (hashCode * 397) ^ GetHashCode(CameraPosition);
                hashCode = (hashCode * 397) ^ GetHashCode(CameraLookAt);
                hashCode = (hashCode * 397) ^ CameraFov.GetHashCode();
                hashCode = (hashCode * 397) ^ AlignCar.GetHashCode();
                hashCode = (hashCode * 397) ^ AlignCameraHorizontally.GetHashCode();
                hashCode = (hashCode * 397) ^ AlignCameraVertically.GetHashCode();
                hashCode = (hashCode * 397) ^ AlignCameraHorizontallyOffsetRelative.GetHashCode();
                hashCode = (hashCode * 397) ^ AlignCameraVerticallyOffsetRelative.GetHashCode();
                hashCode = (hashCode * 397) ^ AlignCameraHorizontallyOffset.GetHashCode();
                hashCode = (hashCode * 397) ^ AlignCameraVerticallyOffset.GetHashCode();
                hashCode = (hashCode * 397) ^ FlatMirror.GetHashCode();
                hashCode = (hashCode * 397) ^ FlatMirrorBlurred.GetHashCode();
                hashCode = (hashCode * 397) ^ FlatMirrorReflectiveness.GetHashCode();
                hashCode = (hashCode * 397) ^ CubemapAmbient.GetHashCode();
                hashCode = (hashCode * 397) ^ CubemapAmbientWhite.GetHashCode();
                hashCode = (hashCode * 397) ^ UseBloom.GetHashCode();
                hashCode = (hashCode * 397) ^ UseSslr.GetHashCode();
                hashCode = (hashCode * 397) ^ UseAo.GetHashCode();
                hashCode = (hashCode * 397) ^ AoType.GetHashCode();
                hashCode = (hashCode * 397) ^ EnableShadows.GetHashCode();
                hashCode = (hashCode * 397) ^ UsePcss.GetHashCode();
                hashCode = (hashCode * 397) ^ ShadowMapSize;
                hashCode = (hashCode * 397) ^ ReflectionCubemapAtCamera.GetHashCode();
                hashCode = (hashCode * 397) ^ ReflectionsWithShadows.GetHashCode();
                hashCode = (hashCode * 397) ^ BackgroundColor.GetHashCode();
                hashCode = (hashCode * 397) ^ LightColor.GetHashCode();
                hashCode = (hashCode * 397) ^ AmbientUp.GetHashCode();
                hashCode = (hashCode * 397) ^ AmbientDown.GetHashCode();
                hashCode = (hashCode * 397) ^ AmbientBrightness.GetHashCode();
                hashCode = (hashCode * 397) ^ BackgroundBrightness.GetHashCode();
                hashCode = (hashCode * 397) ^ LightBrightness.GetHashCode();
                hashCode = (hashCode * 397) ^ GetHashCode(LightDirection);
                hashCode = (hashCode * 397) ^ UseColorGrading.GetHashCode();
                hashCode = (hashCode * 397) ^ ToneExposure.GetHashCode();
                hashCode = (hashCode * 397) ^ ToneGamma.GetHashCode();
                hashCode = (hashCode * 397) ^ ToneWhitePoint.GetHashCode();
                hashCode = (hashCode * 397) ^ GetHashCode(ColorGradingData);
                hashCode = (hashCode * 397) ^ MaterialsReflectiveness.GetHashCode();
                hashCode = (hashCode * 397) ^ BloomRadiusMultiplier.GetHashCode();
                hashCode = (hashCode * 397) ^ PcssSceneScale.GetHashCode();
                hashCode = (hashCode * 397) ^ PcssLightScale.GetHashCode();
                hashCode = (hashCode * 397) ^ SsaoOpacity.GetHashCode();
                return(Convert.ToBase64String(BitConverter.GetBytes(hashCode)).TrimEnd('='));
            }
        }
Пример #14
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Icon.Length != 0)
            {
                hash ^= Icon.GetHashCode();
            }
            if (Prefab.Length != 0)
            {
                hash ^= Prefab.GetHashCode();
            }
            if (Rarity != 0L)
            {
                hash ^= Rarity.GetHashCode();
            }
            if (Description.Length != 0)
            {
                hash ^= Description.GetHashCode();
            }
            if (ShowInVaultItemMenu != false)
            {
                hash ^= ShowInVaultItemMenu.GetHashCode();
            }
            if (Deletable != false)
            {
                hash ^= Deletable.GetHashCode();
            }
            if (ShowInRewardsFlow != false)
            {
                hash ^= ShowInRewardsFlow.GetHashCode();
            }
            if (color_ != null)
            {
                hash ^= Color.GetHashCode();
            }
            if (Background.Length != 0)
            {
                hash ^= Background.GetHashCode();
            }
            if (Ordering != 0)
            {
                hash ^= Ordering.GetHashCode();
            }
            if (rewardSound_ != null)
            {
                hash ^= RewardSound.GetHashCode();
            }
            if (RewardSoundPriority != 0)
            {
                hash ^= RewardSoundPriority.GetHashCode();
            }
            if (SpineAnimatedIcon.Length != 0)
            {
                hash ^= SpineAnimatedIcon.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #15
0
 public override int GetHashCode()
 {
     return((_color.GetHashCode() << 1) + _isHorizontal.GetHashCode());
 }
Пример #16
0
 public override int GetHashCode()
 {
     return(ColorIndex.GetHashCode() ^ Color.GetHashCode());
 }
Пример #17
0
 public void Ensure_that_hash_code_can_be_generated()
 {
     var color = new Color(0, 1, 0);
     Assert.AreEqual(1, color.GetHashCode());
 }
Пример #18
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;

                if (Line != null)
                {
                    hashCode = hashCode * 59 + Line.GetHashCode();
                }

                if (Color != null)
                {
                    hashCode = hashCode * 59 + Color.GetHashCode();
                }

                if (ColorArray != null)
                {
                    hashCode = hashCode * 59 + ColorArray.GetHashCode();
                }

                if (CAuto != null)
                {
                    hashCode = hashCode * 59 + CAuto.GetHashCode();
                }

                if (CMin != null)
                {
                    hashCode = hashCode * 59 + CMin.GetHashCode();
                }

                if (CMax != null)
                {
                    hashCode = hashCode * 59 + CMax.GetHashCode();
                }

                if (CMid != null)
                {
                    hashCode = hashCode * 59 + CMid.GetHashCode();
                }

                if (ColorScale != null)
                {
                    hashCode = hashCode * 59 + ColorScale.GetHashCode();
                }

                if (AutoColorScale != null)
                {
                    hashCode = hashCode * 59 + AutoColorScale.GetHashCode();
                }

                if (ReverseScale != null)
                {
                    hashCode = hashCode * 59 + ReverseScale.GetHashCode();
                }

                if (ShowScale != null)
                {
                    hashCode = hashCode * 59 + ShowScale.GetHashCode();
                }

                if (ColorBar != null)
                {
                    hashCode = hashCode * 59 + ColorBar.GetHashCode();
                }

                if (ColorAxis != null)
                {
                    hashCode = hashCode * 59 + ColorAxis.GetHashCode();
                }

                if (Opacity != null)
                {
                    hashCode = hashCode * 59 + Opacity.GetHashCode();
                }

                if (OpacityArray != null)
                {
                    hashCode = hashCode * 59 + OpacityArray.GetHashCode();
                }

                if (ColorSrc != null)
                {
                    hashCode = hashCode * 59 + ColorSrc.GetHashCode();
                }

                if (OpacitySrc != null)
                {
                    hashCode = hashCode * 59 + OpacitySrc.GetHashCode();
                }

                return(hashCode);
            }
        }
Пример #19
0
 public override int GetHashCode()
 {
     return(_hue.GetHashCode() ^ -0x515897BC);
 }
Пример #20
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;

                if (Show != null)
                {
                    hashCode = hashCode * 59 + Show.GetHashCode();
                }

                if (Start != null)
                {
                    hashCode = hashCode * 59 + Start.GetHashCode();
                }

                if (End != null)
                {
                    hashCode = hashCode * 59 + End.GetHashCode();
                }

                if (Size != null)
                {
                    hashCode = hashCode * 59 + Size.GetHashCode();
                }

                if (Project != null)
                {
                    hashCode = hashCode * 59 + Project.GetHashCode();
                }

                if (Color != null)
                {
                    hashCode = hashCode * 59 + Color.GetHashCode();
                }

                if (UseColorMap != null)
                {
                    hashCode = hashCode * 59 + UseColorMap.GetHashCode();
                }

                if (Width != null)
                {
                    hashCode = hashCode * 59 + Width.GetHashCode();
                }

                if (Highlight != null)
                {
                    hashCode = hashCode * 59 + Highlight.GetHashCode();
                }

                if (HighlightColor != null)
                {
                    hashCode = hashCode * 59 + HighlightColor.GetHashCode();
                }

                if (HighlightWidth != null)
                {
                    hashCode = hashCode * 59 + HighlightWidth.GetHashCode();
                }

                return(hashCode);
            }
        }
Пример #21
0
 public override int GetHashCode()
 {
     return(text.GetHashCode() % fontsize.GetHashCode() % color.GetHashCode());
 }
Пример #22
0
 private int GetKey(Color foreground, Color background, FontStyle style)
 {
     return((((foreground.GetHashCode() * 397) ^ background.GetHashCode()) * 397) ^ style.GetHashCode());
 }
Пример #23
0
 public DrawBatchDataKey(Color c, int mode)
 {
     color  = c;
     glMode = mode;
     m_Hash = glMode ^ (color.GetHashCode() << 2);
 }
Пример #24
0
 public override int GetHashCode()
 {
     return(Color == null ? 0 : Color.GetHashCode());
 }
Пример #25
0
 /// <summary>
 /// Serves as a hash function for a <see cref="ColorGradient"/> object.
 /// </summary>
 /// <returns>
 /// A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
 /// hash table.
 /// </returns>
 public override int GetHashCode()
 {
     return(ObjectX.GenerateHashCode(
                m_MinColor.GetHashCode(), m_MaxColor.GetHashCode(), m_InterpolationSpace.GetHashCode()
                ));
 }
Пример #26
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Symbol != null)
         {
             hashCode = hashCode * 59 + Symbol.GetHashCode();
         }
         if (SymbolArray != null)
         {
             hashCode = hashCode * 59 + SymbolArray.GetHashCode();
         }
         if (Opacity != null)
         {
             hashCode = hashCode * 59 + Opacity.GetHashCode();
         }
         if (OpacityArray != null)
         {
             hashCode = hashCode * 59 + OpacityArray.GetHashCode();
         }
         if (Size != null)
         {
             hashCode = hashCode * 59 + Size.GetHashCode();
         }
         if (SizeArray != null)
         {
             hashCode = hashCode * 59 + SizeArray.GetHashCode();
         }
         if (MaxDisplayed != null)
         {
             hashCode = hashCode * 59 + MaxDisplayed.GetHashCode();
         }
         if (SizeRef != null)
         {
             hashCode = hashCode * 59 + SizeRef.GetHashCode();
         }
         if (SizeMin != null)
         {
             hashCode = hashCode * 59 + SizeMin.GetHashCode();
         }
         if (SizeMode != null)
         {
             hashCode = hashCode * 59 + SizeMode.GetHashCode();
         }
         if (Line != null)
         {
             hashCode = hashCode * 59 + Line.GetHashCode();
         }
         if (Gradient != null)
         {
             hashCode = hashCode * 59 + Gradient.GetHashCode();
         }
         if (Color != null)
         {
             hashCode = hashCode * 59 + Color.GetHashCode();
         }
         if (ColorArray != null)
         {
             hashCode = hashCode * 59 + ColorArray.GetHashCode();
         }
         if (CAuto != null)
         {
             hashCode = hashCode * 59 + CAuto.GetHashCode();
         }
         if (CMin != null)
         {
             hashCode = hashCode * 59 + CMin.GetHashCode();
         }
         if (CMax != null)
         {
             hashCode = hashCode * 59 + CMax.GetHashCode();
         }
         if (CMid != null)
         {
             hashCode = hashCode * 59 + CMid.GetHashCode();
         }
         if (ColorScale != null)
         {
             hashCode = hashCode * 59 + ColorScale.GetHashCode();
         }
         if (AutoColorScale != null)
         {
             hashCode = hashCode * 59 + AutoColorScale.GetHashCode();
         }
         if (ReverseScale != null)
         {
             hashCode = hashCode * 59 + ReverseScale.GetHashCode();
         }
         if (ShowScale != null)
         {
             hashCode = hashCode * 59 + ShowScale.GetHashCode();
         }
         if (ColorBar != null)
         {
             hashCode = hashCode * 59 + ColorBar.GetHashCode();
         }
         if (ColorAxis != null)
         {
             hashCode = hashCode * 59 + ColorAxis.GetHashCode();
         }
         if (SymbolSrc != null)
         {
             hashCode = hashCode * 59 + SymbolSrc.GetHashCode();
         }
         if (OpacitySrc != null)
         {
             hashCode = hashCode * 59 + OpacitySrc.GetHashCode();
         }
         if (SizeSrc != null)
         {
             hashCode = hashCode * 59 + SizeSrc.GetHashCode();
         }
         if (ColorSrc != null)
         {
             hashCode = hashCode * 59 + ColorSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #27
0
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     return(Color.GetHashCode() ^ (Blend.GetHashCode() + 1) ^ ((Hatch.GetHashCode() + 1) << 2));
 }
Пример #28
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;

                if (Title != null)
                {
                    hashCode = hashCode * 59 + Title.GetHashCode();
                }

                if (Color != null)
                {
                    hashCode = hashCode * 59 + Color.GetHashCode();
                }

                if (TickMode != null)
                {
                    hashCode = hashCode * 59 + TickMode.GetHashCode();
                }

                if (NTicks != null)
                {
                    hashCode = hashCode * 59 + NTicks.GetHashCode();
                }

                if (Tick0 != null)
                {
                    hashCode = hashCode * 59 + Tick0.GetHashCode();
                }

                if (DTick != null)
                {
                    hashCode = hashCode * 59 + DTick.GetHashCode();
                }

                if (TickVals != null)
                {
                    hashCode = hashCode * 59 + TickVals.GetHashCode();
                }

                if (TickText != null)
                {
                    hashCode = hashCode * 59 + TickText.GetHashCode();
                }

                if (Ticks != null)
                {
                    hashCode = hashCode * 59 + Ticks.GetHashCode();
                }

                if (TickleN != null)
                {
                    hashCode = hashCode * 59 + TickleN.GetHashCode();
                }

                if (TickWidth != null)
                {
                    hashCode = hashCode * 59 + TickWidth.GetHashCode();
                }

                if (TickColor != null)
                {
                    hashCode = hashCode * 59 + TickColor.GetHashCode();
                }

                if (ShowTickLabels != null)
                {
                    hashCode = hashCode * 59 + ShowTickLabels.GetHashCode();
                }

                if (ShowTickPrefix != null)
                {
                    hashCode = hashCode * 59 + ShowTickPrefix.GetHashCode();
                }

                if (TickPrefix != null)
                {
                    hashCode = hashCode * 59 + TickPrefix.GetHashCode();
                }

                if (ShowTickSuffix != null)
                {
                    hashCode = hashCode * 59 + ShowTickSuffix.GetHashCode();
                }

                if (TickSuffix != null)
                {
                    hashCode = hashCode * 59 + TickSuffix.GetHashCode();
                }

                if (ShowExponent != null)
                {
                    hashCode = hashCode * 59 + ShowExponent.GetHashCode();
                }

                if (ExponentFormat != null)
                {
                    hashCode = hashCode * 59 + ExponentFormat.GetHashCode();
                }

                if (SeparateThousands != null)
                {
                    hashCode = hashCode * 59 + SeparateThousands.GetHashCode();
                }

                if (TickFont != null)
                {
                    hashCode = hashCode * 59 + TickFont.GetHashCode();
                }

                if (TickAngle != null)
                {
                    hashCode = hashCode * 59 + TickAngle.GetHashCode();
                }

                if (TickFormat != null)
                {
                    hashCode = hashCode * 59 + TickFormat.GetHashCode();
                }

                if (TickFormatStops != null)
                {
                    hashCode = hashCode * 59 + TickFormatStops.GetHashCode();
                }

                if (HoverFormat != null)
                {
                    hashCode = hashCode * 59 + HoverFormat.GetHashCode();
                }

                if (ShowLine != null)
                {
                    hashCode = hashCode * 59 + ShowLine.GetHashCode();
                }

                if (LineColor != null)
                {
                    hashCode = hashCode * 59 + LineColor.GetHashCode();
                }

                if (LineWidth != null)
                {
                    hashCode = hashCode * 59 + LineWidth.GetHashCode();
                }

                if (ShowGrid != null)
                {
                    hashCode = hashCode * 59 + ShowGrid.GetHashCode();
                }

                if (GridColor != null)
                {
                    hashCode = hashCode * 59 + GridColor.GetHashCode();
                }

                if (GridWidth != null)
                {
                    hashCode = hashCode * 59 + GridWidth.GetHashCode();
                }

                if (Layer != null)
                {
                    hashCode = hashCode * 59 + Layer.GetHashCode();
                }

                if (UiRevision != null)
                {
                    hashCode = hashCode * 59 + UiRevision.GetHashCode();
                }

                if (TickValsSrc != null)
                {
                    hashCode = hashCode * 59 + TickValsSrc.GetHashCode();
                }

                if (TickTextSrc != null)
                {
                    hashCode = hashCode * 59 + TickTextSrc.GetHashCode();
                }

                return(hashCode);
            }
        }
Пример #29
0
    public override int GetHashCode()
    {
        int hash = 1;

        if (Key.Length != 0)
        {
            hash ^= Key.GetHashCode();
        }
        if (Type != 0)
        {
            hash ^= Type.GetHashCode();
        }
        if (Broadcast != false)
        {
            hash ^= Broadcast.GetHashCode();
        }
        if (Name.Length != 0)
        {
            hash ^= Name.GetHashCode();
        }
        if (Avatar.Length != 0)
        {
            hash ^= Avatar.GetHashCode();
        }
        if (Seat != 0)
        {
            hash ^= Seat.GetHashCode();
        }
        if (RoomKey.Length != 0)
        {
            hash ^= RoomKey.GetHashCode();
        }
        if (RoomName.Length != 0)
        {
            hash ^= RoomName.GetHashCode();
        }
        if (Message.Length != 0)
        {
            hash ^= Message.GetHashCode();
        }
        if (BeginPoint != 0D)
        {
            hash ^= BeginPoint.GetHashCode();
        }
        if (EndPoint != 0D)
        {
            hash ^= EndPoint.GetHashCode();
        }
        if (PenSize != 0)
        {
            hash ^= PenSize.GetHashCode();
        }
        if (Color != 0)
        {
            hash ^= Color.GetHashCode();
        }
        hash ^= users_.GetHashCode();
        hash ^= rooms_.GetHashCode();
        if (Code != 0)
        {
            hash ^= Code.GetHashCode();
        }
        if (Error.Length != 0)
        {
            hash ^= Error.GetHashCode();
        }
        if (Id != 0)
        {
            hash ^= Id.GetHashCode();
        }
        return(hash);
    }
Пример #30
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Visible != null)
         {
             hashCode = hashCode * 59 + Visible.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (AutoRange != null)
         {
             hashCode = hashCode * 59 + AutoRange.GetHashCode();
         }
         if (RangeMode != null)
         {
             hashCode = hashCode * 59 + RangeMode.GetHashCode();
         }
         if (Range != null)
         {
             hashCode = hashCode * 59 + Range.GetHashCode();
         }
         if (CategoryOrder != null)
         {
             hashCode = hashCode * 59 + CategoryOrder.GetHashCode();
         }
         if (CategoryArray != null)
         {
             hashCode = hashCode * 59 + CategoryArray.GetHashCode();
         }
         if (Angle != null)
         {
             hashCode = hashCode * 59 + Angle.GetHashCode();
         }
         if (Side != null)
         {
             hashCode = hashCode * 59 + Side.GetHashCode();
         }
         if (Title != null)
         {
             hashCode = hashCode * 59 + Title.GetHashCode();
         }
         if (HoverFormat != null)
         {
             hashCode = hashCode * 59 + HoverFormat.GetHashCode();
         }
         if (UiRevision != null)
         {
             hashCode = hashCode * 59 + UiRevision.GetHashCode();
         }
         if (Color != null)
         {
             hashCode = hashCode * 59 + Color.GetHashCode();
         }
         if (ShowLine != null)
         {
             hashCode = hashCode * 59 + ShowLine.GetHashCode();
         }
         if (LineColor != null)
         {
             hashCode = hashCode * 59 + LineColor.GetHashCode();
         }
         if (LineWidth != null)
         {
             hashCode = hashCode * 59 + LineWidth.GetHashCode();
         }
         if (ShowGrid != null)
         {
             hashCode = hashCode * 59 + ShowGrid.GetHashCode();
         }
         if (GridColor != null)
         {
             hashCode = hashCode * 59 + GridColor.GetHashCode();
         }
         if (GridWidth != null)
         {
             hashCode = hashCode * 59 + GridWidth.GetHashCode();
         }
         if (TickMode != null)
         {
             hashCode = hashCode * 59 + TickMode.GetHashCode();
         }
         if (NTicks != null)
         {
             hashCode = hashCode * 59 + NTicks.GetHashCode();
         }
         if (Tick0 != null)
         {
             hashCode = hashCode * 59 + Tick0.GetHashCode();
         }
         if (DTick != null)
         {
             hashCode = hashCode * 59 + DTick.GetHashCode();
         }
         if (TickVals != null)
         {
             hashCode = hashCode * 59 + TickVals.GetHashCode();
         }
         if (TickText != null)
         {
             hashCode = hashCode * 59 + TickText.GetHashCode();
         }
         if (Ticks != null)
         {
             hashCode = hashCode * 59 + Ticks.GetHashCode();
         }
         if (TickLen != null)
         {
             hashCode = hashCode * 59 + TickLen.GetHashCode();
         }
         if (TickWidth != null)
         {
             hashCode = hashCode * 59 + TickWidth.GetHashCode();
         }
         if (TickColor != null)
         {
             hashCode = hashCode * 59 + TickColor.GetHashCode();
         }
         if (ShowTickLabels != null)
         {
             hashCode = hashCode * 59 + ShowTickLabels.GetHashCode();
         }
         if (ShowTickPrefix != null)
         {
             hashCode = hashCode * 59 + ShowTickPrefix.GetHashCode();
         }
         if (TickPrefix != null)
         {
             hashCode = hashCode * 59 + TickPrefix.GetHashCode();
         }
         if (ShowTickSuffix != null)
         {
             hashCode = hashCode * 59 + ShowTickSuffix.GetHashCode();
         }
         if (TickSuffix != null)
         {
             hashCode = hashCode * 59 + TickSuffix.GetHashCode();
         }
         if (ShowExponent != null)
         {
             hashCode = hashCode * 59 + ShowExponent.GetHashCode();
         }
         if (ExponentFormat != null)
         {
             hashCode = hashCode * 59 + ExponentFormat.GetHashCode();
         }
         if (MinExponent != null)
         {
             hashCode = hashCode * 59 + MinExponent.GetHashCode();
         }
         if (SeparateThousands != null)
         {
             hashCode = hashCode * 59 + SeparateThousands.GetHashCode();
         }
         if (TickFont != null)
         {
             hashCode = hashCode * 59 + TickFont.GetHashCode();
         }
         if (TickAngle != null)
         {
             hashCode = hashCode * 59 + TickAngle.GetHashCode();
         }
         if (TickFormat != null)
         {
             hashCode = hashCode * 59 + TickFormat.GetHashCode();
         }
         if (TickFormatStops != null)
         {
             hashCode = hashCode * 59 + TickFormatStops.GetHashCode();
         }
         if (Layer != null)
         {
             hashCode = hashCode * 59 + Layer.GetHashCode();
         }
         if (Calendar != null)
         {
             hashCode = hashCode * 59 + Calendar.GetHashCode();
         }
         if (CategoryArraySrc != null)
         {
             hashCode = hashCode * 59 + CategoryArraySrc.GetHashCode();
         }
         if (TickValsSrc != null)
         {
             hashCode = hashCode * 59 + TickValsSrc.GetHashCode();
         }
         if (TickTextSrc != null)
         {
             hashCode = hashCode * 59 + TickTextSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
 /// <summary>
 /// Returns the hash code for this instance.
 /// </summary>
 /// <returns>
 /// A 32-bit signed integer that is the hash code for this instance.
 /// </returns>
 public override int GetHashCode()
 {
     return(Position.GetHashCode() + Color.GetHashCode());
 }
Пример #32
0
 public override int GetHashCode()
 {
     return(Color.GetHashCode() ^ ButtonColor.GetHashCode() ^ ColorChanged.GetHashCode() ^ FontStyle.GetHashCode() ^ Fontname.GetHashCode());
 }
Пример #33
0
        /// <summary>
        /// Serves as a hash of this type.
        /// </summary>
        /// <returns>A hash code for the current instance.</returns>
        public override int GetHashCode()
        {
            UpdateColor();

            return(Color.GetHashCode());
        }
Пример #34
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Visible != null)
         {
             hashCode = hashCode * 59 + Visible.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Symmetric != null)
         {
             hashCode = hashCode * 59 + Symmetric.GetHashCode();
         }
         if (Array != null)
         {
             hashCode = hashCode * 59 + Array.GetHashCode();
         }
         if (ArrayMinus != null)
         {
             hashCode = hashCode * 59 + ArrayMinus.GetHashCode();
         }
         if (Value != null)
         {
             hashCode = hashCode * 59 + Value.GetHashCode();
         }
         if (ValueMinus != null)
         {
             hashCode = hashCode * 59 + ValueMinus.GetHashCode();
         }
         if (TraceRef != null)
         {
             hashCode = hashCode * 59 + TraceRef.GetHashCode();
         }
         if (TraceRefMinus != null)
         {
             hashCode = hashCode * 59 + TraceRefMinus.GetHashCode();
         }
         if (Color != null)
         {
             hashCode = hashCode * 59 + Color.GetHashCode();
         }
         if (Thickness != null)
         {
             hashCode = hashCode * 59 + Thickness.GetHashCode();
         }
         if (Width != null)
         {
             hashCode = hashCode * 59 + Width.GetHashCode();
         }
         if (ArraySrc != null)
         {
             hashCode = hashCode * 59 + ArraySrc.GetHashCode();
         }
         if (ArrayMinusSrc != null)
         {
             hashCode = hashCode * 59 + ArrayMinusSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #35
0
        /*
         * CreateTexture
         * Returns the texture2D to use for each GoL cell
         * can be any size, but is pixelScale * pixelScale by default
         */
        private Texture2D CreateTexture(Color colour)
        {
            Texture2D newTexture = new Texture2D(GraphicsDevice, pixelScale, pixelScale);

            int[] pixelTexture = new int[pixelScale * pixelScale];

            int whiteColour = colour.GetHashCode();
            for (int i = 0; i < pixelScale * pixelScale; i++)
            {
                pixelTexture[i] = whiteColour;
            }

            newTexture.SetData<int>(pixelTexture);
            return newTexture;
        }