14 * @param [in] a Width value .
15 * @param [in] b Height value.
17 public Size(float a, float b)
23 * @brief default constructor
34 * @brief constructor with base class object
37 * @param [in] o The Vector2 with Width, Height values.
39 public Size(Vector2 o)
46 * @brief Copy constructor
49 * @param [in] o The Size having Width & Y.
57 ///< name "W", type float (Size Width value)
62 set { width = value; }
65 ///< name "H", type float (Size Height value)
69 get { return height; }
70 set { height = value; }
77 * @param [in] l The Size to add.
78 * @param [in] r The Size to add
79 * @return A reference to this
81 public static Size operator +(Size l, Size r)
83 return new Size(l.W + r.W, l.H + r.H);
90 * @param [in] l The Size to substract.
91 * @param [in] r The Size to substract
92 * @return A reference to this
94 public static Size operator -(Size l, Size r)
96 return new Size(l.W - r.W, l.H - r.H);
103 * @param [in] a The Size to multiply
104 * @param [in] b The constant to multiply of type double.
105 * @return A reference to this
107 public static Size operator *(Size a, double b)
109 return new Size((float)(a.W * b), (float)(a.H * b));
116 * @param [in] a The Size to divide.
117 * @param [in] b The Size to divide
118 * @return float of the size division
120 public static float operator /(Size a, Size b)
122 return (float)System.Math.Sqrt((a.W / b.W) * (a.H / b.H));
129 * @param [in] a The Size object to compare.
130 * @param [in] b The Size object to compare.
131 * @return bool, whether Size are equal or not
133 public static bool operator == (Size a, Size b)
135 return a.W == b.W && a.H == b.H ;
142 * @param [in] a The Size object to compare.
143 * @param [in] b The Size object to compare.
144 * @return bool, whether Size are equal or not
146 public static bool operator != (Size a, Size b)
148 return a.W != b.W || a.H != b.H;
155 * @return int, hascode of Size
157 public override int GetHashCode()
166 * @return returns a copy of Size object
170 Size copy = new Size(W, H);
174 // User-defined conversion from Position to Vector3
175 public static implicit operator Vector2(Size size)
177 return new Vector2(size.width, size.height);
180 public static implicit operator Size(Vector2 vec)
182 return new Size(vec.x, vec.y);