Example #1
0
        public override int GetHashCode()
        {
            var hashCode = -1055164333;

            hashCode = hashCode * -1521134295 + EqualityComparer <Vector2Int> .Default.GetHashCode(PlayerCoords);

            hashCode = hashCode * -1521134295 + Type.GetHashCode();
            return(hashCode);
        }
Example #2
0
        /// <summary>
        /// Returns a hash code for this instance.
        /// </summary>
        /// <returns>A hash code for this instance.</returns>
        public override int GetHashCode()
        {
            int hash = StateType.GetHashCode();

            hash = ((hash << 2) - hash) + _impl.AddressU.GetHashCode();
            hash = ((hash << 2) - hash) + _impl.AddressV.GetHashCode();
            hash = ((hash << 2) - hash) + _impl.AddressW.GetHashCode();
            hash = ((hash << 2) - hash) + _impl.Filter.GetHashCode();
            hash = ((hash << 2) - hash) + _impl.MipMapLevelOfDetailBias.GetHashCode();
            hash = ((hash << 2) - hash) + _impl.MaxAnisotropy;
            return(hash);
        }
Example #3
0
        /// <summary>
        /// Returns a hash code for this instance.
        /// </summary>
        /// <returns>A hash code for this instance.</returns>
        public override int GetHashCode()
        {
            int hash = StateType.GetHashCode();

            hash = ((hash << 2) - hash) + ((_impl.DepthEnable) ? 1 : 0);
            hash = ((hash << 2) - hash) + ((_impl.DepthWriteEnable) ? 1 : 0);
            hash = ((hash << 2) - hash) + _impl.DepthFunction.GetHashCode();
            hash = ((hash << 2) - hash) + ((_impl.StencilEnable) ? 1 : 0);
            hash = ((hash << 2) - hash) + ((_impl.TwoSidedStencilEnable) ? 1 : 0);
            hash = ((hash << 2) - hash) + _impl.ReferenceStencil;
            hash = ((hash << 2) - hash) + _impl.StencilFunction.GetHashCode();
            hash = ((hash << 2) - hash) + _impl.StencilDepthFail.GetHashCode();
            hash = ((hash << 2) - hash) + _impl.StencilFail.GetHashCode();
            hash = ((hash << 2) - hash) + _impl.StencilPass.GetHashCode();
            hash = ((hash << 2) - hash) + _impl.CounterClockwiseStencilFunction.GetHashCode();
            hash = ((hash << 2) - hash) + _impl.CounterClockwiseStencilDepthFail.GetHashCode();
            hash = ((hash << 2) - hash) + _impl.CounterClockwiseStencilFail.GetHashCode();
            hash = ((hash << 2) - hash) + _impl.CounterClockwiseStencilPass.GetHashCode();
            hash = ((hash << 2) - hash) + (_impl.StencilWriteMask % int.MaxValue);
            hash = ((hash << 2) - hash) + (_impl.StencilReadMask % int.MaxValue);
            return(hash);
        }
Example #4
0
        /// <summary>
        /// Returns a hash code for this instance.
        /// </summary>
        /// <returns>A hash code for this instance.</returns>
        public override int GetHashCode()
        {
            int hash = StateType.GetHashCode();

            for (int i = 0; i < _impl.BlendEnableCount; i++)
            {
                hash = ((hash << 2) - hash) + ((_impl.GetBlendEnable(i)) ? 1 : 0);
            }

            for (int i = 0; i < _impl.ColorWriteChannelsCount; i++)
            {
                hash = ((hash << 2) - hash) + _impl.GetWriteChannels(i).GetHashCode();
            }

            hash = ((hash << 2) - hash) + _impl.AlphaBlendFunction.GetHashCode();
            hash = ((hash << 2) - hash) + _impl.AlphaSourceBlend.GetHashCode();
            hash = ((hash << 2) - hash) + _impl.AlphaDestinationBlend.GetHashCode();
            hash = ((hash << 2) - hash) + _impl.ColorBlendFunction.GetHashCode();
            hash = ((hash << 2) - hash) + _impl.ColorSourceBlend.GetHashCode();
            hash = ((hash << 2) - hash) + _impl.ColorDestinationBlend.GetHashCode();
            hash = ((hash << 2) - hash) + (_impl.MultiSampleMask % int.MaxValue);
            return(hash);
        }