コード例 #1
0
ファイル: DumpTruck.cs プロジェクト: Kiesum/hets
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                int hash = 41;
                // Suitable nullity checks

                hash = hash * 59 + Id.GetHashCode();

                if (IsSingleAxle != null)
                {
                    hash = hash * 59 + IsSingleAxle.GetHashCode();
                }

                if (IsTandemAxle != null)
                {
                    hash = hash * 59 + IsTandemAxle.GetHashCode();
                }

                if (IsTridem != null)
                {
                    hash = hash * 59 + IsTridem.GetHashCode();
                }

                if (HasPUP != null)
                {
                    hash = hash * 59 + HasPUP.GetHashCode();
                }

                if (HasBellyDump != null)
                {
                    hash = hash * 59 + HasBellyDump.GetHashCode();
                }

                if (HasRockBox != null)
                {
                    hash = hash * 59 + HasRockBox.GetHashCode();
                }

                if (HasHiliftGate != null)
                {
                    hash = hash * 59 + HasHiliftGate.GetHashCode();
                }

                if (IsWaterTruck != null)
                {
                    hash = hash * 59 + IsWaterTruck.GetHashCode();
                }

                if (HasSealcoatHitch != null)
                {
                    hash = hash * 59 + HasSealcoatHitch.GetHashCode();
                }

                if (RearAxleSpacing != null)
                {
                    hash = hash * 59 + RearAxleSpacing.GetHashCode();
                }

                if (FrontTireSize != null)
                {
                    hash = hash * 59 + FrontTireSize.GetHashCode();
                }

                if (FrontTireUOM != null)
                {
                    hash = hash * 59 + FrontTireUOM.GetHashCode();
                }

                if (FrontAxleCapacity != null)
                {
                    hash = hash * 59 + FrontAxleCapacity.GetHashCode();
                }

                if (RearAxleCapacity != null)
                {
                    hash = hash * 59 + RearAxleCapacity.GetHashCode();
                }

                if (LegalLoad != null)
                {
                    hash = hash * 59 + LegalLoad.GetHashCode();
                }

                if (LegalCapacity != null)
                {
                    hash = hash * 59 + LegalCapacity.GetHashCode();
                }

                if (LegalPUPTareWeight != null)
                {
                    hash = hash * 59 + LegalPUPTareWeight.GetHashCode();
                }

                if (LicencedGVW != null)
                {
                    hash = hash * 59 + LicencedGVW.GetHashCode();
                }

                if (LicencedGVWUOM != null)
                {
                    hash = hash * 59 + LicencedGVWUOM.GetHashCode();
                }

                if (LicencedTareWeight != null)
                {
                    hash = hash * 59 + LicencedTareWeight.GetHashCode();
                }

                if (LicencedPUPTareWeight != null)
                {
                    hash = hash * 59 + LicencedPUPTareWeight.GetHashCode();
                }

                if (LicencedLoad != null)
                {
                    hash = hash * 59 + LicencedLoad.GetHashCode();
                }

                if (LicencedCapacity != null)
                {
                    hash = hash * 59 + LicencedCapacity.GetHashCode();
                }

                if (BoxLength != null)
                {
                    hash = hash * 59 + BoxLength.GetHashCode();
                }

                if (BoxWidth != null)
                {
                    hash = hash * 59 + BoxWidth.GetHashCode();
                }

                if (BoxHeight != null)
                {
                    hash = hash * 59 + BoxHeight.GetHashCode();
                }

                if (BoxCapacity != null)
                {
                    hash = hash * 59 + BoxCapacity.GetHashCode();
                }

                if (TrailerBoxLength != null)
                {
                    hash = hash * 59 + TrailerBoxLength.GetHashCode();
                }

                if (TrailerBoxWidth != null)
                {
                    hash = hash * 59 + TrailerBoxWidth.GetHashCode();
                }

                if (TrailerBoxHeight != null)
                {
                    hash = hash * 59 + TrailerBoxHeight.GetHashCode();
                }

                if (TrailerBoxCapacity != null)
                {
                    hash = hash * 59 + TrailerBoxCapacity.GetHashCode();
                }

                return(hash);
            }
        }