Browse Source

Added = operator

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

+ 10 - 0
Source/Urho3D/Math/Color.h

@@ -89,6 +89,16 @@ public:
         a_(data[3])
         a_(data[3])
     {
     {
     }
     }
+    
+    /// Assign from another color.
+    Color& operator =(const Color& rhs)
+    {
+        r_ = rhs.r_;
+        g_ = rhs.g_;
+        b_ = rhs.b_;
+        a_ = rhs.a_;
+        return *this;
+    }    
 
 
     /// Test for equality with another color without epsilon.
     /// Test for equality with another color without epsilon.
     bool operator ==(const Color& rhs) const { return r_ == rhs.r_ && g_ == rhs.g_ && b_ == rhs.b_ && a_ == rhs.a_; }
     bool operator ==(const Color& rhs) const { return r_ == rhs.r_ && g_ == rhs.g_ && b_ == rhs.b_ && a_ == rhs.a_; }