public static T1 Min <T1>(this Tuple3 <T1, T1, T1> t) where T1 : IComparable <T1>
 {
     if (t.first.CompareTo(t.second) < 0)
     {
         if (t.first.CompareTo(t.third) < 0)
         {
             return(t.first);
         }
         else
         {
             return(t.third);
         }
     }
     else if (t.second.CompareTo(t.third) < 0)
     {
         return(t.second);
     }
     else
     {
         return(t.third);
     }
 }
Ejemplo n.º 2
0
        public static bool operator ==(Tuple3 <T1, T2, T3> a, Tuple3 <T1, T2, T3> b)
        {
            if (Tuple3 <T1, T2, T3> .IsNull(a) && !Tuple3 <T1, T2, T3> .IsNull(b))
            {
                return(false);
            }

            if (!Tuple3 <T1, T2, T3> .IsNull(a) && Tuple3 <T1, T2, T3> .IsNull(b))
            {
                return(false);
            }

            if (Tuple3 <T1, T2, T3> .IsNull(a) && Tuple3 <T1, T2, T3> .IsNull(b))
            {
                return(true);
            }

            return
                (a.first.Equals(b.first) &&
                 a.second.Equals(b.second) &&
                 a.third.Equals(b.third));
        }
Ejemplo n.º 3
0
 public Tuple4(Tuple3 <T1, T2, T3> _tuple3, T4 _fourth)
     : this(_tuple3.first, _tuple3.second, _tuple3.third, _fourth)
 {
 }