コード例 #1
0
            public override bool Equals(object obj)
            {
                Good2 rhs = obj as Good2;

                if ((object)rhs == null)
                {
                    return(false);
                }

                return(name == rhs.name && weight == rhs.weight);
            }
コード例 #2
0
            public int CompareTo(Good2 rhs)
            {
                int result = m_name.CompareTo(rhs.m_name);

                if (result == 0)
                {
                    result = m_address.CompareTo(rhs.m_address);
                }

                return(result);
            }
コード例 #3
0
            public override bool Equals(object rhsObj)
            {
                if (rhsObj == null)
                {
                    return(false);
                }

                Good2 rhs = rhsObj as Good2;

                return(m_name == rhs.m_name && m_address == rhs.m_address);
            }
コード例 #4
0
            public override bool Equals(object rhsObj)
            {
                if (rhsObj == null)
                {
                    return(false);
                }

                Good2 rhs = rhsObj as Good2;

                return(this == rhs);
            }
コード例 #5
0
            public static bool operator==(Good3 lhs, Good3 rhs)
            {
                Good2 ick = new Good2();

                if (lhs.name == ick.IckyField)                  // ok to use fields from other types
                {
                    return(rhs.name.Length == 0 && lhs.weight == rhs.weight);
                }
                else
                {
                    return(lhs.name == rhs.name && lhs.weight == rhs.weight);
                }
            }
コード例 #6
0
            // Equals matches GetHashCode
            public bool Equals(Good2 rhs)
            {
                if (object.ReferenceEquals(this, rhs))
                {
                    return(true);
                }

                if ((object)rhs == null)
                {
                    return(false);
                }

                return(name == rhs.name && address == rhs.address);
            }
コード例 #7
0
 public void Verify2E()
 {
     if (!Timer.gameEnded && !EquationControl.verified2 && !EquationControl.controlLoss)
     {
         if (EquationControl.n3 == EquationControl.CorrectInts[1])
         {
             Bad2.SetActive(false);
             Good2.SetActive(true);
             FindObjectOfType <SoundManager>().PlaySound("success3");
             EquationControl.score++;
             EquationControl.verified2 = true;
         }
         else
         {
             FindObjectOfType <SoundManager>().PlaySound("incorrectanswer");
             Bad2.SetActive(true);
         }
     }
 }
コード例 #8
0
            public bool Equals(Good2 rhs)
            {
                if (object.ReferenceEquals(this, rhs))
                {
                    return(true);
                }

                if ((object)rhs == null)
                {
                    return(false);
                }

                if (!base.Equals(rhs))
                {
                    return(false);
                }

                return(state == rhs.state);
            }
コード例 #9
0
            // Equals matches GetHashCode
            public bool Equals(Good2 rhs)
            {
                if (object.ReferenceEquals(this, rhs))
                    return true;

                if ((object) rhs == null)
                    return false;

                return name == rhs.name && address == rhs.address;
            }
コード例 #10
0
ファイル: ObjectHashCodeTest.cs プロジェクト: dbremner/smokey
            public bool Equals(Good2 rhs)
            {
                if (object.ReferenceEquals(this, rhs))
                    return true;

                if ((object) rhs == null)
                    return false;

                if (!base.Equals(rhs))
                    return false;

                return state == rhs.state;
            }