5 public class Size : Vector2
12 * @param [in] a Width value .
13 * @param [in] b Height value.
15 public Size(float a, float b)
20 * @brief default constructor
30 * @brief constructor with base class object
33 * @param [in] o The Vector2 with Width, Height values.
35 public Size(Vector2 o)
42 * @brief Copy constructor
45 * @param [in] o The Size having Width & Y.
48 : base(a.width, a.height)
52 ///< name "W", type float (Size Width value)
57 set { width = value; }
60 ///< name "H", type float (Size Height value)
64 get { return height; }
65 set { height = value; }
72 * @param [in] l The Size to add.
73 * @param [in] r The Size to add
74 * @return A reference to this
76 public static Size operator +(Size l, Size r)
78 return new Size(l.W + r.W, l.H + r.H);
85 * @param [in] l The Size to substract.
86 * @param [in] r The Size to substract
87 * @return A reference to this
89 public static Size operator -(Size l, Size r)
91 return new Size(l.W - r.W, l.H - r.H);
98 * @param [in] a The Size to multiply
99 * @param [in] b The Size to multiply
100 * @return A reference to this
102 public static Size operator *(Size a, double b)
104 return new Size((int)(a.W * b), (int)(a.H * b));
111 * @param [in] a The Size to divide.
112 * @param [in] b The Size to divide
113 * @return float of the size division
115 public static float operator /(Size a, Size b)
117 return (float)System.Math.Sqrt((a.W / b.W) * (a.H / b.H));
124 * @param [in] obj The Size object to compare.
125 * @return bool, whether object equal or not
127 public override bool Equals(object obj)
129 Size that = obj as Size;
134 return this.W == that.W && this.H == that.H;
141 * @return int, hascode of Size
143 public override int GetHashCode()
152 * @return returns a copy of Size object
156 Size copy = new Size(W, H);