Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int prime  = 31;
            int result = 1;

            result = prime * result + ((ActiveCells == null) ? 0 : ActiveCells.GetHashCode());
            result = prime * result + ((PredictiveCells == null) ? 0 : PredictiveCells.GetHashCode());
            result = prime * result + ((WinnerCells == null) ? 0 : WinnerCells.GetHashCode());
            result = prime * result + ((ActiveSegments == null) ? 0 : ActiveSegments.GetHashCode());
            result = prime * result + ((MatchingSegments == null) ? 0 : MatchingSegments.GetHashCode());
            return(result);
        }
Beispiel #2
0
        /* (non-Javadoc)
         * @see java.lang.Object#equals(java.lang.Object)
         */

        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }
            ComputeCycle other = (ComputeCycle)obj;

            if (ActiveCells == null)
            {
                if (other.ActiveCells != null)
                {
                    return(false);
                }
            }
            else if (!ActiveCells.Equals(other.ActiveCells))
            {
                return(false);
            }
            if (PredictiveCells == null)
            {
                if (other.PredictiveCells != null)
                {
                    return(false);
                }
            }
            else if (!PredictiveCells.Equals(other.PredictiveCells))
            {
                return(false);
            }
            if (WinnerCells == null)
            {
                if (other.WinnerCells != null)
                {
                    return(false);
                }
            }
            else if (!WinnerCells.Equals(other.WinnerCells))
            {
                return(false);
            }
            if (ActiveSegments == null)
            {
                if (other.ActiveSegments != null)
                {
                    return(false);
                }
            }
            else if (!ActiveSegments.Equals(other.ActiveSegments))
            {
                return(false);
            }
            if (MatchingSegments == null)
            {
                if (other.MatchingSegments != null)
                {
                    return(false);
                }
            }
            else if (!MatchingSegments.Equals(other.MatchingSegments))
            {
                return(false);
            }
            return(true);
        }