コード例 #1
0
ファイル: Tuple2i.cs プロジェクト: carlhuth/GenXSource
        /// <summary>  Clamps the tuple parameter to the range [low, high] and
        /// places the values into this tuple.
        /// </summary>
        /// <param name="min">  the lowest value in the tuple after clamping
        /// </param>
        /// <param name="max"> the highest value in the tuple after clamping
        /// </param>
        /// <param name="t">  the source tuple, which will not be modified
        /// </param>
        public void  clamp(int min, int max, Tuple2i t)
        {
            if (t.x > max)
            {
                x = max;
            }
            else if (t.x < min)
            {
                x = min;
            }
            else
            {
                x = t.x;
            }

            if (t.y > max)
            {
                y = max;
            }
            else if (t.y < min)
            {
                y = min;
            }
            else
            {
                y = t.y;
            }
        }
コード例 #2
0
ファイル: Tuple2i.cs プロジェクト: carlhuth/GenXSource
 /// <summary> Returns true if the Object t1 is of type Tuple2i and all of the
 /// data members of t1 are equal to the corresponding data members in
 /// this Tuple2i.
 /// </summary>
 /// <param name="t1"> the object with which the comparison is made
 /// </param>
 public override bool Equals(System.Object t1)
 {
     try
     {
         Tuple2i t2 = (Tuple2i)t1;
         return(this.x == t2.x && this.y == t2.y);
     }
     catch (System.NullReferenceException e2)
     {
         return(false);
     }
     catch (System.InvalidCastException e1)
     {
         return(false);
     }
 }
コード例 #3
0
ファイル: Tuple2i.cs プロジェクト: carlhuth/GenXSource
        /// <summary>  Clamps the minimum value of the tuple parameter to the min
        /// parameter and places the values into this tuple.
        /// </summary>
        /// <param name="min">  the lowest value in the tuple after clamping
        /// </param>
        /// <param name="t">  the source tuple, which will not be modified
        /// </param>
        public void  clampMin(int min, Tuple2i t)
        {
            if (t.x < min)
            {
                x = min;
            }
            else
            {
                x = t.x;
            }

            if (t.y < min)
            {
                y = min;
            }
            else
            {
                y = t.y;
            }
        }
コード例 #4
0
ファイル: Tuple2i.cs プロジェクト: carlhuth/GenXSource
        /// <summary>  Clamps the maximum value of the tuple parameter to the max
        /// parameter and places the values into this tuple.
        /// </summary>
        /// <param name="max">  the highest value in the tuple after clamping
        /// </param>
        /// <param name="t">  the source tuple, which will not be modified
        /// </param>
        public void  clampMax(int max, Tuple2i t)
        {
            if (t.x > max)
            {
                x = max;
            }
            else
            {
                x = t.x;
            }

            if (t.y > max)
            {
                y = max;
            }
            else
            {
                y = t.y;
            }
        }
コード例 #5
0
ファイル: Tuple2i.cs プロジェクト: carlhuth/GenXSource
 /// <summary> Copies the values of this tuple into the tuple t.</summary>
 /// <param name="t">is the target tuple
 /// </param>
 public void  get_Renamed(Tuple2i t)
 {
     t.x = this.x;
     t.y = this.y;
 }
コード例 #6
0
ファイル: Tuple2i.cs プロジェクト: carlhuth/GenXSource
 /// <summary> Sets the value of this tuple to the value of tuple t1.</summary>
 /// <param name="t1">the tuple to be copied
 /// </param>
 public void  set_Renamed(Tuple2i t1)
 {
     this.x = t1.x;
     this.y = t1.y;
 }
コード例 #7
0
ファイル: Tuple2i.cs プロジェクト: carlhuth/GenXSource
 /// <summary> Constructs and initializes a Tuple2i from the specified Tuple2i.</summary>
 /// <param name="t1">the Tuple2i containing the initialization x and y
 /// data.
 /// </param>
 public Tuple2i(Tuple2i t1)
 {
     this.x = t1.x;
     this.y = t1.y;
 }
コード例 #8
0
ファイル: Tuple2i.cs プロジェクト: xuchuansheng/GenXSource
		/// <summary> Sets the value of this tuple to the sum of itself and t1.</summary>
		/// <param name="t1">the other tuple
		/// </param>
		public void  add(Tuple2i t1)
		{
			this.x += t1.x;
			this.y += t1.y;
		}
コード例 #9
0
ファイル: Tuple2i.cs プロジェクト: carlhuth/GenXSource
 /// <summary> Sets the value of this tuple to the scalar multiplication
 /// of itself and then adds tuple t1 (this = s*this + t1).
 /// </summary>
 /// <param name="s">the scalar value
 /// </param>
 /// <param name="t1">the tuple to be added
 /// </param>
 public void  scaleAdd(int s, Tuple2i t1)
 {
     this.x = s * this.x + t1.x;
     this.y = s * this.y + t1.y;
 }
コード例 #10
0
ファイル: Tuple2i.cs プロジェクト: carlhuth/GenXSource
 /// <summary> Sets the value of this tuple to the negation of tuple t1.</summary>
 /// <param name="t1">the source tuple
 /// </param>
 public void  negate(Tuple2i t1)
 {
     this.x = -t1.x;
     this.y = -t1.y;
 }
コード例 #11
0
ファイル: Tuple2i.cs プロジェクト: carlhuth/GenXSource
 /// <summary> Sets the value of this tuple to the difference
 /// of tuples t1 and t2 (this = t1 - t2).
 /// </summary>
 /// <param name="t1">the first tuple
 /// </param>
 /// <param name="t2">the second tuple
 /// </param>
 public void  sub(Tuple2i t1, Tuple2i t2)
 {
     this.x = t1.x - t2.x;
     this.y = t1.y - t2.y;
 }
コード例 #12
0
ファイル: Tuple2i.cs プロジェクト: xuchuansheng/GenXSource
		/// <summary>  Clamps the minimum value of the tuple parameter to the min
		/// parameter and places the values into this tuple.
		/// </summary>
		/// <param name="min">  the lowest value in the tuple after clamping
		/// </param>
		/// <param name="t">  the source tuple, which will not be modified
		/// </param>
		public void  clampMin(int min, Tuple2i t)
		{
			if (t.x < min)
			{
				x = min;
			}
			else
			{
				x = t.x;
			}
			
			if (t.y < min)
			{
				y = min;
			}
			else
			{
				y = t.y;
			}
		}
コード例 #13
0
ファイル: Tuple2i.cs プロジェクト: xuchuansheng/GenXSource
		/// <summary>  Clamps the tuple parameter to the range [low, high] and
		/// places the values into this tuple.
		/// </summary>
		/// <param name="min">  the lowest value in the tuple after clamping
		/// </param>
		/// <param name="max"> the highest value in the tuple after clamping
		/// </param>
		/// <param name="t">  the source tuple, which will not be modified
		/// </param>
		public void  clamp(int min, int max, Tuple2i t)
		{
			if (t.x > max)
			{
				x = max;
			}
			else if (t.x < min)
			{
				x = min;
			}
			else
			{
				x = t.x;
			}
			
			if (t.y > max)
			{
				y = max;
			}
			else if (t.y < min)
			{
				y = min;
			}
			else
			{
				y = t.y;
			}
		}
コード例 #14
0
ファイル: Tuple2i.cs プロジェクト: xuchuansheng/GenXSource
		/// <summary> Sets the value of this tuple to the scalar multiplication
		/// of itself and then adds tuple t1 (this = s*this + t1).
		/// </summary>
		/// <param name="s">the scalar value
		/// </param>
		/// <param name="t1">the tuple to be added
		/// </param>
		public void  scaleAdd(int s, Tuple2i t1)
		{
			this.x = s * this.x + t1.x;
			this.y = s * this.y + t1.y;
		}
コード例 #15
0
ファイル: Tuple2i.cs プロジェクト: xuchuansheng/GenXSource
		/// <summary> Sets the value of this tuple to the scalar multiplication
		/// of tuple t1.
		/// </summary>
		/// <param name="s">the scalar value
		/// </param>
		/// <param name="t1">the source tuple
		/// </param>
		public void  scale(int s, Tuple2i t1)
		{
			this.x = s * t1.x;
			this.y = s * t1.y;
		}
コード例 #16
0
ファイル: Tuple2i.cs プロジェクト: xuchuansheng/GenXSource
		/// <summary> Sets the value of this tuple to the negation of tuple t1.</summary>
		/// <param name="t1">the source tuple
		/// </param>
		public void  negate(Tuple2i t1)
		{
			this.x = - t1.x;
			this.y = - t1.y;
		}
コード例 #17
0
ファイル: Tuple2i.cs プロジェクト: xuchuansheng/GenXSource
		/// <summary> Sets the value of this tuple to the difference
		/// of itself and t1 (this = this - t1).
		/// </summary>
		/// <param name="t1">the other tuple
		/// </param>
		public void  sub(Tuple2i t1)
		{
			this.x -= t1.x;
			this.y -= t1.y;
		}
コード例 #18
0
ファイル: Tuple2i.cs プロジェクト: xuchuansheng/GenXSource
		/// <summary> Sets the value of this tuple to the difference
		/// of tuples t1 and t2 (this = t1 - t2).
		/// </summary>
		/// <param name="t1">the first tuple
		/// </param>
		/// <param name="t2">the second tuple
		/// </param>
		public void  sub(Tuple2i t1, Tuple2i t2)
		{
			this.x = t1.x - t2.x;
			this.y = t1.y - t2.y;
		}
コード例 #19
0
ファイル: Tuple2i.cs プロジェクト: carlhuth/GenXSource
 /// <summary> Sets the value of this tuple to the sum of tuples t1 and t2.</summary>
 /// <param name="t1">the first tuple
 /// </param>
 /// <param name="t2">the second tuple
 /// </param>
 public void  add(Tuple2i t1, Tuple2i t2)
 {
     this.x = t1.x + t2.x;
     this.y = t1.y + t2.y;
 }
コード例 #20
0
ファイル: Tuple2i.cs プロジェクト: carlhuth/GenXSource
 /// <summary> Sets the value of this tuple to the sum of itself and t1.</summary>
 /// <param name="t1">the other tuple
 /// </param>
 public void  add(Tuple2i t1)
 {
     this.x += t1.x;
     this.y += t1.y;
 }
コード例 #21
0
ファイル: Tuple2i.cs プロジェクト: xuchuansheng/GenXSource
		/// <summary>  Clamps the maximum value of the tuple parameter to the max
		/// parameter and places the values into this tuple.
		/// </summary>
		/// <param name="max">  the highest value in the tuple after clamping
		/// </param>
		/// <param name="t">  the source tuple, which will not be modified
		/// </param>
		public void  clampMax(int max, Tuple2i t)
		{
			if (t.x > max)
			{
				x = max;
			}
			else
			{
				x = t.x;
			}
			
			if (t.y > max)
			{
				y = max;
			}
			else
			{
				y = t.y;
			}
		}
コード例 #22
0
ファイル: Tuple2i.cs プロジェクト: carlhuth/GenXSource
 /// <summary> Sets the value of this tuple to the difference
 /// of itself and t1 (this = this - t1).
 /// </summary>
 /// <param name="t1">the other tuple
 /// </param>
 public void  sub(Tuple2i t1)
 {
     this.x -= t1.x;
     this.y -= t1.y;
 }
コード例 #23
0
ファイル: Tuple2i.cs プロジェクト: xuchuansheng/GenXSource
		/// <summary> Copies the values of this tuple into the tuple t.</summary>
		/// <param name="t">is the target tuple
		/// </param>
		public void  get_Renamed(Tuple2i t)
		{
			t.x = this.x;
			t.y = this.y;
		}
コード例 #24
0
ファイル: Tuple2i.cs プロジェクト: carlhuth/GenXSource
 /// <summary> Sets the value of this tuple to the scalar multiplication
 /// of tuple t1.
 /// </summary>
 /// <param name="s">the scalar value
 /// </param>
 /// <param name="t1">the source tuple
 /// </param>
 public void  scale(int s, Tuple2i t1)
 {
     this.x = s * t1.x;
     this.y = s * t1.y;
 }
コード例 #25
0
ファイル: Tuple2i.cs プロジェクト: xuchuansheng/GenXSource
		/// <summary> Sets the value of this tuple to the value of tuple t1.</summary>
		/// <param name="t1">the tuple to be copied
		/// </param>
		public void  set_Renamed(Tuple2i t1)
		{
			this.x = t1.x;
			this.y = t1.y;
		}
コード例 #26
0
ファイル: Tuple2i.cs プロジェクト: xuchuansheng/GenXSource
		/// <summary>  Sets each component of the tuple parameter to its absolute
		/// value and places the modified values into this tuple.
		/// </summary>
		/// <param name="t">  the source tuple, which will not be modified
		/// </param>
		public void  absolute(Tuple2i t)
		{
			x = System.Math.Abs(t.x);
			y = System.Math.Abs(t.y);
		}
コード例 #27
0
ファイル: Tuple2i.cs プロジェクト: xuchuansheng/GenXSource
		/// <summary> Sets the value of this tuple to the sum of tuples t1 and t2.</summary>
		/// <param name="t1">the first tuple
		/// </param>
		/// <param name="t2">the second tuple
		/// </param>
		public void  add(Tuple2i t1, Tuple2i t2)
		{
			this.x = t1.x + t2.x;
			this.y = t1.y + t2.y;
		}
コード例 #28
0
 /// <summary> Constructs and initializes a Point2i from the specified Tuple2i.</summary>
 /// <param name="t1">the Tuple2i containing the initialization x and y
 /// data.
 /// </param>
 public Point2i(Tuple2i t1) : base(t1)
 {
 }
コード例 #29
0
ファイル: Point2i.cs プロジェクト: xuchuansheng/GenXSource
		/// <summary> Constructs and initializes a Point2i from the specified Tuple2i.</summary>
		/// <param name="t1">the Tuple2i containing the initialization x and y
		/// data.
		/// </param>
		public Point2i(Tuple2i t1):base(t1)
		{
		}
コード例 #30
0
ファイル: Tuple2i.cs プロジェクト: carlhuth/GenXSource
 /// <summary>  Sets each component of the tuple parameter to its absolute
 /// value and places the modified values into this tuple.
 /// </summary>
 /// <param name="t">  the source tuple, which will not be modified
 /// </param>
 public void  absolute(Tuple2i t)
 {
     x = System.Math.Abs(t.x);
     y = System.Math.Abs(t.y);
 }
コード例 #31
0
ファイル: Tuple2i.cs プロジェクト: xuchuansheng/GenXSource
		/// <summary> Constructs and initializes a Tuple2i from the specified Tuple2i.</summary>
		/// <param name="t1">the Tuple2i containing the initialization x and y
		/// data.
		/// </param>
		public Tuple2i(Tuple2i t1)
		{
			this.x = t1.x;
			this.y = t1.y;
		}