Пример #1
0
#pragma warning restore 618

        internal Hash128 GetHash()
        {
            var h  = new Hash128();
            var h2 = new Hash128();

            HashUtilities.ComputeHash128(ref bufferClearing, ref h);
            HashUtilities.ComputeHash128(ref culling, ref h2);
            HashUtilities.AppendHash(ref h2, ref h);
            HashUtilities.ComputeHash128(ref customRenderingSettings, ref h2);
            HashUtilities.AppendHash(ref h2, ref h);
            HashUtilities.ComputeHash128(ref defaultFrameSettings, ref h2);
            HashUtilities.AppendHash(ref h2, ref h);
            HashUtilities.ComputeHash128(ref flipYMode, ref h2);
            HashUtilities.AppendHash(ref h2, ref h);
            HashUtilities.ComputeHash128(ref frustum, ref h2);
            HashUtilities.AppendHash(ref h2, ref h);
            HashUtilities.ComputeHash128(ref invertFaceCulling, ref h2);
            HashUtilities.AppendHash(ref h2, ref h);
            HashUtilities.ComputeHash128(ref probeLayerMask, ref h2);
            HashUtilities.AppendHash(ref h2, ref h);
            HashUtilities.ComputeHash128(ref probeRangeCompressionFactor, ref h2);
            HashUtilities.AppendHash(ref h2, ref h);
            HashUtilities.ComputeHash128(ref renderingPathCustomFrameSettings, ref h2);
            HashUtilities.AppendHash(ref h2, ref h);
            HashUtilities.ComputeHash128(ref renderingPathCustomFrameSettingsOverrideMask, ref h2);
            HashUtilities.AppendHash(ref h2, ref h);
            int volumeHash = volumes.GetHashCode();

            h2 = new Hash128((ulong)volumeHash, 0);
            HashUtilities.AppendHash(ref h2, ref h);

            return(h);
        }
Пример #2
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (Id != null)
                {
                    hashCode = hashCode * 59 + Id.GetHashCode();
                }

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

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

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

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

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

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

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

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

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

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

                return(hashCode);
            }
        }