コード例 #1
0
ファイル: PlayerPreference.cs プロジェクト: Shirkie01/Nitrox
        public override int GetHashCode()
        {
            unchecked
            {
                int hashCode = PlayerName != null?PlayerName.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ RedAdditive.GetHashCode();
                hashCode = (hashCode * 397) ^ GreenAdditive.GetHashCode();
                hashCode = (hashCode * 397) ^ BlueAdditive.GetHashCode();
                return(hashCode);
            }
        }
コード例 #2
0
ファイル: PlayerPreference.cs プロジェクト: Shirkie01/Nitrox
        public bool Equals(PlayerPreference other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(string.Equals(PlayerName, other.PlayerName) && RedAdditive.Equals(other.RedAdditive) && GreenAdditive.Equals(other.GreenAdditive) && BlueAdditive.Equals(other.BlueAdditive));
        }