Browse Source

Added = operator

Added assign operator since there is a copy constructor. (More consistent)
cosmy1 10 years ago
parent
commit
3e62884d69
1 changed files with 8 additions and 0 deletions
  1. 8 0
      Source/Urho3D/Math/Vector2.h

+ 8 - 0
Source/Urho3D/Math/Vector2.h

@@ -253,6 +253,14 @@ public:
     {
     }
 
+    /// Assign from another vector.
+    IntVector2& operator =(const IntVector2& rhs)
+    {
+        x_ = rhs.x_;
+        y_ = rhs.y_;
+        return *this;
+    }
+
     /// Test for equality with another vector.
     bool operator ==(const IntVector2& rhs) const { return x_ == rhs.x_ && y_ == rhs.y_; }