Beispiel #1
0
 public uiBorderStyleState(uiBorderStyleState st)
 {
     this.size         = st.size;
     this.color        = st.color;
     this.stipple_size = st.stipple_size;
     this.stipple_gap  = st.stipple_gap;
 }
Beispiel #2
0
        public override bool Equals(object obj)
        {
            uiBorderStyleState o = (uiBorderStyleState)obj;
            bool sizeEq          = (((o.size == null) == (this.size == null)) && Util.floatEq(o.size.left, size.left) && Util.floatEq(o.size.right, size.right) && Util.floatEq(o.size.top, size.top) && Util.floatEq(o.size.bottom, size.bottom));
            bool colorEq         = (o.color.HasValue == this.color.HasValue);

            //if both colors have a value then we want to be more specific with our equality check.
            if (colorEq && this.color.HasValue)
            {
                colorEq = (Util.floatEq(o.color.Value.r, this.color.Value.r) && Util.floatEq(o.color.Value.b, this.color.Value.b) && Util.floatEq(o.color.Value.g, this.color.Value.g) && Util.floatEq(o.color.Value.a, this.color.Value.a));
            }

            return(sizeEq && colorEq);
        }
Beispiel #3
0
 public void take(uiBorderStyleState st)
 {
     if (st.size != null)
     {
         size = st.size;
     }
     if (st.color.HasValue)
     {
         color = st.color;
     }
     if (st.texture != null)
     {
         texture = st.texture;
     }
     if (st.stipple_size.HasValue)
     {
         stipple_size = st.stipple_size;
     }
     if (st.stipple_gap.HasValue)
     {
         stipple_gap = st.stipple_gap;
     }
 }